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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...