Splunk Search

How do you extract the key/field from a common value?

proletariat99
Communicator

If I search for a generic term -- say, "John Doe" and I get thousands of results from dozens of sourcetypes, how can I return the field/key name where John Doe exists?

For instance, if a proxy calls it, "user" and another sourcetype calls it "User" and another finds "John Doe" in "URL" or "admin_name" etc etc..., how can I return the field names where this value exists at search time?

I have tried eval, extract, values and fieldsummary but with no luck (could be a syntax thing, I'm relatively new to SPL)

Thanks.

Tags (3)
0 Karma

proletariat99
Communicator

Heh. I was just about to pose the same question when I ran across my old question and literally thought, "Oh hey! That's the exact same problem I have!"

Oh. That was me. Duh.

0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee

You could build extracts for each type of sourcetype and all it USER. Each sourcetype would have a different field extraction, but they would all be called USER. Or, let them all extract as different field names and then use the ALIAS in Splunk to name them all the same thing.

0 Karma

proletariat99
Communicator

Thanks for the response. I'm still learning how to extract kv pairs, but wouldn't this solution still require me to manually go through each sourcetype and enumerate which field contains my value (user)?

I have to do this hundreds of times in the coming months, with dozens of sourcetypes per search (note: This would be a non-issue if we had the CIM all dialed in, but we have many custom TAs that aren't perfect yet, and many weird sourcetypes.)

Any other suggestions for returning the field name from a particular value?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...