Splunk Search

adding data from lookup to search

smudge797
Path Finder

I have a spreadsheet.csv with the following info:
date, SID
16/03/2016, x555xx5x5
...

I want to add the SID value as Account_Name to search:

index=blah source=blah.log Account_Name= |stats count

Whats the most efficient method and example in distributed environment?

Thanks in advance!

0 Karma

somesoni2
Revered Legend

Try something like this (based on where you've your csv file, choose between inputcsv( if in $SPLUNK_HOME/var/run/splunk) or inputlookup (if it's added as lookup table file $SPLUNK_HOME/etc/apps/AppName/lookups)

index=blah source=*blah.log [inputcsv spreadsheet.csv | stats count by SID | table SID | rename SID as Account_Name] |stats count

smudge797
Path Finder

cool thanks!

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...