Splunk Search

Help with search then loookup

luuken
New Member

Hi,

The following is my search:

index=pace ERROR OR FATAL OUI=* Number=*
| stats count by OUI Number
| sort -count

 

After executing the above search i get the following results:

 

OUI Number count

9C3DCF4W12757WA51F61880CC9C4W15177LA0AD1100836C94W150B70A38374100C6B4W15077PA0682380CC9C4W151778A0A39380CC9C4W15177GA0A5D3


Note: The number column are the results I am interested in.


I have a separate table named subsdeviceextract.csv as per the following:

MACModelOUIPost CodeSerial Number08:36:C9:9A:F4:6CV65100836C927754W150B70A012A08:36:C9:9B:5C:FEV65100836C964374W150B70A07A808:36:C9:9C:A8:20V65100836C926414W150B70A110A


I would like to look up the Serial number to get the Model Number

Please help me, thank you

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Firstly - you did something strange with tables in your post. It's unreadable 🙂

Secondly - just use lookup.

 

index=pace ERROR OR FATAL OUI=* Number=*
| stats count by OUI Number
| sort -count
| lookup subsdeviceextract.csv "Serial Number" AS Number OUTPUT Model

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @luuken,

you have to put your table in a lookup called e.g. subsdeviceextract.csv (for more infos see at (https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup) and then run a search like this:

index=pace ERROR OR FATAL OUI=* Number=*
| stats count by OUI Number
| lookup subsdeviceextract.csv OUI OUTPUT Model
| sort -count
| table OUI Number count Model

If you like, you can use also other fields from your lookup.

Ciao.

Giuseppe

 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...