Splunk Search

How can I use sha1 in my Splunk search

pk87
Engager

We save hash values from our ids and I want to search for them. I would expected I can do it this way:

index=blub id=sha1("11122233") 

But unfurtonaly it doesn't work. Also other attemps failed (for exampe to eval it first in a new variable). If I just use the sha1 it return the correct value, but somehow it doesn't work in the search. 


Can anybody help here or has suggestion. 

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
index=blub
| id=sha1("11122233")
| where 'properties.id'=id

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=blub
| where id=sha1("11122233")
0 Karma

pk87
Engager

I tried this, but don' get results

 

index=blub sourcetype=blub:nadev | where properties.id = sha1("SNL123456789454651")

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

That would seem to suggest that properties.id does not contain the sha1 of "SNL123456789454651", at least not as the only thing in it.

Do you have some example event you can share which are not being found when they should?

0 Karma

pk87
Engager

image.pngimage.pngimage.png

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=blub
| id=sha1("11122233")
| where 'properties.id'=id
0 Karma

pk87
Engager

I am not able to find anything with the where statement. Even if I use directly the hash value.

 

So this works:

index=rtt properties.vin = "d7a4acc844c8176009371c65c63bd07c929d4738"

but this doesn't:

index=rtt | where properties.vin = "d7a4acc844c8176009371c65c63bd07c929d4738"

0 Karma

pk87
Engager

I missed this part. now it works!

 

index=rtt | where 'properties.vin' = sha1("SNL23456789185206")

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try with the field name in single quotes (as I showed in my example)

0 Karma

pk87
Engager

I missed this part. now it works!

 

index=rtt | where 'properties.vin' = sha1("SNL23456789185206")

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...