Getting Data In

Input First Line of File

cdobie
New Member

I have the requirement of inputing only the first line of a file. The first line is of interest then the rest of the file is not needed. The file will be rewritten with new values and again I require just to input the first line of the file.

Is there a way to just take in the first line and then dump the rest of the file each time Splunk looks at the file?

Tags (1)
0 Karma

Ayn
Legend

Nope, not easily with the regular file monitor. If you can identify the data you want through some sort of pattern you can setup rules for throwing all the other events (see http://docs.splunk.com/Documentation/Splunk/6.0/Forwarding/Routeandfilterdatad ). Otherwise your best bet is to setup a scripted input so you can put your case-specific logic in the script that you use for retrieving the events.

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

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