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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...