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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...