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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...