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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...