Splunk Search

Search _raw for values in a csv?

rbogner
Engager

I've confirmed that the following search works:

index=* sourcetype=proxy | eval domain="google" | where match(_raw,domain) | table _raw

but instead of defining domain on the command line, I'd like to pull values from a column called domain in the file ioc.csv that I uploaded.

Any ideas?

Tags (2)
0 Karma

sundareshr
Legend

Try this

index=* sourcetype=proxy [ inputlookup mydomains | table domain | eval domain="*".domain."*" | rename domain AS search | format]

dshpritz
SplunkTrust
SplunkTrust

You can do this with a subsearch:

index=* sourcetype=proxy [ inputlookup mydomains | table domain | rename domain AS search | format]

If you specifically wanted to check the domain field for a match, you could use the following:

index=* sourcetype=proxy [ inputlookup mydomains | fields domain]

As long as the field name in the input matches the field name in the data (for example if you have a field in the lookup named "domain" and then the field in your proxy data is "domain" as well). If the field names do not match, you can use a rename command in the subsearch:

index=* sourcetype=proxy [ inputlookup mydomains | fields badguy | rename badguy AS domain]

rbogner
Engager

Great stuff, thanks guys.

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...