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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...