Splunk Search

How to add eventtype to search results?

gunslinger
Explorer

I need to understand which event types each search result record belongs to.

My search:

index="a" AND eventtype="*"

I want the results to contain a field with a list of matching event types.

It would be ok for me to have a table with columns _raw and eventtypes.

We have 10k+ event types and thousands of events.

Is it possible to achieve?

Thanks.

Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @gunslinger,

your requirement isn't so clear for me, could you better describe it?

it seems that you want a table with the raw events and the eventtypes defined for each event.

If this is your requirement, you could try something like this:

index="a" eventtype="*"
| table eventtype _raw

but is this what you want?

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @gunslinger,

your requirement isn't so clear for me, could you better describe it?

it seems that you want a table with the raw events and the eventtypes defined for each event.

If this is your requirement, you could try something like this:

index="a" eventtype="*"
| table eventtype _raw

but is this what you want?

Ciao.

Giuseppe

gunslinger
Explorer

thank you, for some reason I thought I need some special expression to get the event type as a field

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Are you saying that each event may have more than one event type?

Have these event types already been extracted or are you asking for help to extract them?

It might be useful if you could share some anonymised events (in a code block </> to preserve formatting etc.)

Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...