Splunk Dev

How to search for "Roberto Carlos" in text-only files ?

wajihullahbaig
Explorer

I have just indexed a few plain text files using Splunk Web gui. Now I am trying to retrieve some results using the Java SDK. I am not sure of the search queries. What would be my search query if I want to search all the files for "Roberto Carlos" and if I need to get the top 10 results?

Guidance much appreciated as I am new to splunk.

Tags (3)
0 Karma
1 Solution

cvajs
Contributor

not knowing what your indexes or terms are called,
index=text_files " Roberto Carlos " | top filename limit=10

View solution in original post

cvajs
Contributor

not knowing what your indexes or terms are called,
index=text_files " Roberto Carlos " | top filename limit=10

wajihullahbaig
Explorer

Yes...I was just looking at the XML the search returned. Therefore it is now much easier to understand. Thanks.

cvajs
Contributor

you can see extracted fields from a general search on the left side, it will show you the fields which you can then use to act on in a search, eg "filename", etc.

wajihullahbaig
Explorer

Much appreciated. Thanks

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...