Getting Data In

Upload txt file - metafields source and sourcetype not searchable

danielwysockiar
Explorer

Hello,
i just uploaded a txt file with some logs, through GUI Add data ->upload.
Data is indexed, and I can search it by typing

index = test

I can see that all metafields like source and sourcetype has been assigneged according to my settings, but....
when i search for

source = my_source

or

  sourcetype = mylogfile.txt

i get zero results.....

I know that no stanzas are generated in inputs.conf when you upload a file, but is it normal behaviour in case of uploading files?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

When index is not specified in a search, Splunk will only search the default index(es) defined for your role. Often, that is just 'main'. If you search for index=test sourcetype=mylogfile.txt you should get results.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

When index is not specified in a search, Splunk will only search the default index(es) defined for your role. Often, that is just 'main'. If you search for index=test sourcetype=mylogfile.txt you should get results.

---
If this reply helps you, Karma would be appreciated.
0 Karma

renjith_nair
Legend

@danielwysockiarrow,
While you are uploading the file, if you have selected upload instead of monitor splunk does not need to add an entry to the inputs.conf because it doesn't need to monitor a file. For the search with sourcetype and source, do you have the role capabilities Indexes searched by default to All non-internal indexes ?

---
What goes around comes around. If it helps, hit it with Karma 🙂

danielwysockiar
Explorer

I've selected upload and also oneshot command, both ways do not let me search by source or sourcetype.
As for the role capabilities, I had Indexes searched by default set to main only.
That was it! Thank you sir!

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[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 ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...