Splunk Search

Is it possible to run a search on a log file that would pull the log lines above and below the returned result?

vinay4444
Explorer

Is it possible to run a search on a log file that would pull the log lines above and below the returned result? I want to look in the Directory for people called Alex, plus 100 names above them and 100 names below them in the alphabetical list.

0 Karma

esix_splunk
Splunk Employee
Splunk Employee

Splunk works on time series data. If your log files are time series based, you can do a temporal filter for events within + or - X time of the core event your are looking for.

There is no baseline show me "+/-100 events from this time, in alphabetical order" type of command.

Depending on what you are wanting to do, you could find your person Named alex, sort 201 names between that event and filter alphabetically. But again, this is not time series based data, and doesnt fit a Splunk use case very well.

0 Karma

vinay4444
Explorer

Thanks for response , it will be time series here is an example
TIME NAME VALUE
01/08/2016 1:00 ABC 10
01/08/2016 2:00 ABC 10
01/08/2016 3:00 Alex 50
01/08/2016 4:00 CDX 60
01/08/2016 5:00 ABC 20

The result i would need is search for Alex and result should be (+1 and -1 records)
01/08/2016 2:00 ABC 10
01/08/2016 3:00 Alex 50
01/08/2016 4:00 CDX 60

What would be search to achieve this

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...