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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...