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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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