Splunk Search

How to extract more logs after searching for particular string?

mfshravan
New Member

Hi All,

I would like to extract more logs after searching for particular string.

Eg.,

I want to search with string "Myname" and i want to see 3 lines along with search string in output

Note : 3 lines are not constant and keeps on changes

abcdefghijklmnop

1234567890

Myname

dsadasdasd

1231232131231

asdasdasdas

 

Expected result

Myname

dsadasdasd

1231232131231

asdasdasdas

 

dsasaasdsa

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...