3

I have a set of records with multiple duplicate values across two fields X, and Y. I would like to write a splunk query to find distinct X, and its corresponding Y value. I am completely lost, and have no clue on how to come up with this query. Can someone please help?

Rob
  • 11,492
  • 14
  • 59
  • 94
rickygrimes
  • 2,637
  • 9
  • 46
  • 69

3 Answers3

4

What you're looking for is probably as simple as

| dedup X Y | table X Y

This will find all distinct combinations of X and Y and remove all duplicates, then display the result in a table.

Syon
  • 7,205
  • 5
  • 36
  • 40
2
stats values(x) by y

or

stats values(y) by x

Depending on how you want to view the data. Per Splunk documentation, "In a distributed environment, stats is likely to be faster, because the indexers can "prestats" before sending their results to the search head"

sk8asd123
  • 1,665
  • 16
  • 14