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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...