Monitoring Splunk

how can i get the line count(records) of a file without reading the complete file

prakashbhanu407
New Member

I need to get the records count only from a file , so is there a way without reading/indexing the complete file ?

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Instead of indexing the entire file ( monitor:// input) you could build a scripted or modular input that looks at your file, computes the record count, outputs that record count into Splunk and index that.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Instead of indexing the entire file ( monitor:// input) you could build a scripted or modular input that looks at your file, computes the record count, outputs that record count into Splunk and index that.

0 Karma

somesoni2
Revered Legend

In Splunk, (I hope)
Event count

| tstats count WHERE index=yourindex sourcetype=yoursourcetype source=filethatyouwantthecountfrom 

Line Count

your base search to select that file | stats sum(line_count) as linecount
0 Karma
Get Updates on the Splunk Community!

Splunk Lantern | Spotlight on Security: Adoption Motions, War Stories, and More

Splunk Lantern is a customer success center that provides advice from Splunk experts on valuable data ...

Splunk Cloud | Empowering Splunk Administrators with Admin Config Service (ACS)

Greetings, Splunk Cloud Admins and Splunk enthusiasts! The Admin Configuration Service (ACS) team is excited ...

Tech Talk | One Log to Rule Them All

One log to rule them all: how you can centralize your troubleshooting with Splunk logs We know how important ...