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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...