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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...