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!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...