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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...