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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...