Splunk Search

why is the values() function truncating or rounding my field values?

skinnygav
New Member

Hi, my price field has values 7.75372, 7.75373, 7.75375. If i pipe these results to chart values(price) by _time it charts all values as 7.754. Why is it doing this and how do i stop it from happening? I want to chart the raw values.

Tags (3)
0 Karma

ngatchasandra
Builder

Hi,
Sorry, i don't have the permissions to add comment!
I do not have any problems when i run your search. It is either your version of splunk or your search before pipe? I run this search index=values | chart values(price) by _time the results display like this in splunk 6.1.4:

time                                       values(price)
2015-01-16 14:12:07                           7.75372
                                              7.75373
                                              7.75374

MuS
Legend

It's okay not to post a comment, because this is correct. values does not truncate anything. Take this run everywhere example and see for yourself that the KBPS are mostly numbers around 0.[\d]{6} (that is a null point followed by 6 digits)

index=_internal earliest=-7d@d latest=-1d@d | timechart span=1min values(kbps) AS KBPS

cheers, MuS

0 Karma

skinnygav
New Member

it is not a multi valued field, using list(price) does not change anything. Splunk is really bad at handling raw data.

0 Karma

aweitzman
Motivator

I can't seem to duplicate this problem. Are you sure that the values are what you think they are before you get to the chart command?

If they are, then what happens if you explicitly declare the precision?

...your search... | eval actualprice=round(price,5) | chart values(actualprice) by _time

0 Karma

somesoni2
Revered Legend

The price is a multivalued field? What happens when you use "list" instead of "values"?

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...