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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...