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
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...