Splunk Enterprise

How to get unique data?

Keerthi
Path Finder

Keerthi_0-1684304562915.png

Hi All,

I have a query and the results shows as above. The column function as only single value. I need to get only one value instead of two as the_time also remains same. Can anyone help me to get single value instead of the value repeating twice.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You could hardcode replacements of incorrect spellings with correct spellings replace function 

View solution in original post

0 Karma

Keerthi
Path Finder

Hi Sir,

I tried but still am getting two values.

Keerthi_0-1684310460325.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Field names are case-sensitive - try using Function instead of function.

(My excuse is that I was unable to accurately copy your image into a text box - in future, it is usually best to use the code block </> option to include SPL or event text so that formatting and typos are reduced.)

0 Karma

Keerthi
Path Finder

I tried keeping the case sensitive topic in my mind but it still fetches 2 rows.
i tried using:

|stats first(Function) command to get the first row. But the query when applied to filter does not produce the result.

Keerthi_0-1684407658208.pngKeerthi_1-1684407692688.png

Keerthi_2-1684407710288.png



any help here pls

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If you just want the first event, use this

| head 1
0 Karma

Keerthi
Path Finder

Thnaks that worked, but i lately realised one thing that the names ( i mean the spelling) is wrong. is there nay chance to hardcode the value manually in splunk.

Keerthi_0-1684411246989.png

HELP PLS!!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could hardcode replacements of incorrect spellings with correct spellings replace function 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your SPL is correct for what you are trying to achieve - what may not be "correct" is your data. Does the function have trailing white spaces for example, which makes them look the same but in fact they are different?

You could try trimming the field before the dedup

| savedsearch blah
| fields function
| eval function=trim(function)
| dedup function
| sort function
0 Karma
Get Updates on the Splunk Community!

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

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...