Show surrounding messages
Have a dropdown on the search result pages: "Show X [hours/minutes/seconds] of surrounding messages".
The default value could be a per stream configuration option, as well as a global option per user. In the sense that the values would cascade, to provide the most intuitive interface for each use case. I assume this would apply to various other options as well.
Think about how the intentions when looking at application logs with stack traces is much different to say looking at http access logs.
I'm running graylog2 to gather logs from a cluster of multiple load-balanced weblogic servers.
Currently, when I search for messages, I want to be able to see surrounding log entries. I can only see the lines with messages I search for (which is the intended search functionality).
I want to add functionality to be able to search for a message then click a button to see 20 (configurable number limit) lines before and after the message. Or possibly 5 minutes (again, configurable time limit) before and after the message.
Also, maybe I could have a tag from the specific server to filter by server that sent the message.
This was closed but it doesn't seem like it was implemented. Am I missing something about how to do this? I'm running 0.20.1.
This issue is not closed. The referenced issue #302 was closed.
#755 is related.
If my search result shows me 10 events, where surrounding messages will be? Before/after each event or before/after event set?
+1 I need this for apache error logs which often span over several rows, so If I find one row of the error, I want to easily show the lines both before and after this. Also by assigning filter like only from that specific path variable.
@kiranos You could use mod_unique_id to generate a unique ID for each request and add an extractor to your Graylog2 input which extracts that information into an additional field which you can query.
+1 I miss the grep -A num and -B feature
-A num, --after-context=num
Print num lines of trailing context after each match. See also the -B and -C options.
-B num, --before-context=num
Print num lines of leading context before each match. See also the -A and -C options.
When do you expect this issue be closed? Thanks
I agree with @d0x this would be a really useful feature
I would like to +1 d0x on this request as well. I have logs to review to troubleshoot issues with JSON. When I search for "INVALID JSON STRING" in the error message, I need to see the line before to examine the string to resolve the issue. grep -B 1 INVALID filename is perfect for this since all of the entries are on the same screen if there are multiple incidents. I could use the datetime to show lines around the entry to see the action but if I have 6 or 7 to resolve, I have to note the datetime and do the search that many times.
+1 here as well. I have set up streams with only ERRORs, and when the devs check the dahboard, they need to see the lines before the error. Would be very useful. Thanks.
+1
+1
+1
+1
Lead here by link that said it would be in v0.20 in Jan 2014. http://grokbase.com/t/gg/graylog2/13c3dp4j42/context-in-quick-filter-searches-like-grep-c-10-mysearch-mylog-log-in-grep
Just to add a UI suggestion for this from https://groups.google.com/forum/#!topic/graylog2/Kvg7yfVn_po , the 'time' portion of the search specification form could be enhanced to have a third option: "relative to time". (The existing to are "relative to now" and "absolute".) This option would allow specifying an absolute time point and then relative windows backward and forward (either with sliders or dropdowns). Then a button could be added to the message detail panel (or even the results table row) "Show surrounding messages" which simply prefills that "relative to time" part of the search form.
Why you can not implement this really useful simple feature since 2013? You have completely rewrite web UI in new version, but you are not able to add simple button with small JavaScript logic.
@rumatoest as usual, PRs are welcome :)