Splunk Search

How to select distinct rows from a lookup table?

kdoma
Explorer

How to select only distinct rows from the lookup table? I am selecting student details but I have duplicates in the lookup, so how to select only distinct rows from lookup?

0 Karma
1 Solution

somesoni2
Revered Legend

You can use dedup command to remove deplicates. Just identify the fields which can be used to uniquely identify a student (as studentID OR firstname-lastname combination OR something, and use those fields in dedup.

| inputlookup yourlookuptableName.csv | dedup primarykeyfield/primarykeyfieldsSeparatedByComma

View solution in original post

0 Karma

somesoni2
Revered Legend

You can use dedup command to remove deplicates. Just identify the fields which can be used to uniquely identify a student (as studentID OR firstname-lastname combination OR something, and use those fields in dedup.

| inputlookup yourlookuptableName.csv | dedup primarykeyfield/primarykeyfieldsSeparatedByComma
0 Karma

kdoma
Explorer

I got it Dedup function has worked

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...