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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...