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!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...