Splunk Enterprise

How to count the words in the file without indexing the data?

Ashwini008
Builder

I have file(text file) in my UF .My requirement is that i want to know the word count of the file but i should not index the data due to business reasons.

Is there any way where i can get to know the word count of my file without actually indexing the whole data?

Currently i am indexing only filename .Now how can i proceed further?

Thank you

 

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi @Ashwini008 ...on linux(unix as well), you can use the "wc -w" to count the number of words. 


[sekar@ubuntu ~]$ more test.log
test file one two three
[sekar@ubuntu ~]$ wc test.log
1 5 24 test.log
[sekar@ubuntu ~]$ wc -w test.log
5 test.log
[sekar@ubuntu ~]$

 

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma

isoutamo
SplunkTrust
SplunkTrust
And if you need this to splunk then create scripted input for it.
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

wc (word count) is usually available on *nix machines

Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...