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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...