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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...