Splunk Search

Why are stats values and data not aligning?

AK89
Explorer

In this scenario, each HOST_NAME has many HOME_LOCATIONS. Each HOME_LOCATION has unique info - in this case, the RDBMS_VERSION and the DATABASE_RELEASE.

I am trying to produce a simple statistics table that shows each unique HOME_LOCATION (and accompanying info) for each HOST_NAME. 

--------------------

When I run the below (1st screen shot) the data is aligned as I'd expect it to

| stats values(HOME_LOCATION) values(RDBMS_VERSION) by HOST_NAME

2 fields.png

When I run the below (2nd screen shot) and add the third values field in red, the data becomes misaligned for some rows

| stats values(HOME_LOCATION) values(RDBMS_VERSION) values(DATABASE_RELEASE) by HOST_NAME

3 fields.png

What am I missing or doing incorrectly?

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

values() shows the unique values sorted in lexicographical order - if you want to maintain a one-to-one correspondence use list() instead of values() however this does not dedup the values so you may end up with duplicates.

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

values() shows the unique values sorted in lexicographical order - if you want to maintain a one-to-one correspondence use list() instead of values() however this does not dedup the values so you may end up with duplicates.

AK89
Explorer

Appreciate the quick response! This works. As for dupes, my data is pulled in on a scheduled basis, so I can use the time range to handle dupes. Thank you!

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