Splunk Search

Display 3 neighbor line before and after searching text

prakarn_c
Engager

Suppose I have following data

a
b
c
d
e
f
g
h

i

then, I search "e" and would like to show its 3 neighbor line for both before and after the search text found. I want the search result show like this.
c
d
e
f
g
Could you please advise? Please note that the data doesn't contain the time.
Thank you.

Tags (2)

Ayn
Legend

The data itself doesn't contain the time, but Splunk will assign a timestamp to it nevertheless. Anyways, the answer is that unfortunately it can't be EASILY done. It's been discussed in detail here: http://splunk-base.splunk.com/answers/2602/can-splunk-filtermatch-events-and-bring-back-neighbouring...

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 ...