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
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...