Dashboards & Visualizations

How to Stop automatic formatting from HEX to INT in Splunk Dashboard Studio?

tudorex5
Explorer

Hello,

I am trying to make a table viz in my absolute dashboard studio dashboard. I have a query that has a field called "Failure_Code" that usually presents the hex values (0x18 or 0x12). When developing the query in the search app, the data gets printed in the table statistics as is (in 0x.... format) . That is how I would like it to be printed out in my dashboard.

As soon as I add the query into a table view in a dashboard, it automatically gets converted to int(24, 18...). I am not using any eval, stats or renaming on this field. I tried adding a formatting option on that column, noticed it's automatically set to "number" in the context stanza(formatting function), and modified it to "string" in the JSON source code but it didn't stop the formatting. 
I tried the tonumber(myField,"hex") solution but my field was turned to null, and also replacing hex with 16. I tried printf, nothing seems to work.

Thank you for the help!

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Please try upgrading to the latest version of Splunk (it works on 9.1.0.2, but not on 8.2.2.1)

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| eval myField=tostring(myField,"hex")

tudorex5
Explorer

Thanks for the quick reply.

Unfortunately, using | eval Failure_Code=tostring(Failure_Code,"hex") turns the entire field to null values : 

tudorex5_0-1692801456075.png

Here it is, working in a normal search query, without the eval (exact same query, opened from the dashboard panel with the "Open in search" option):

tudorex5_1-1692801514142.png

 

And here is the result without the eval, in the dashboard table  : 

tudorex5_2-1692801578855.png

Added SS for clarification, in case my question was all over the place.

Can I use some type of sed/replace or something similar to add quotes to my failure_code or force it into a string value any other way? I'd rather just have it print out clean, like in the normal search, but dashboard studio seems to be doing some behind the scenes formatting that I don;t really get the hang of yet.

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Which version of Splunk are you using?

tudorex5
Explorer

Enterprise 9.0.0.1 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please try upgrading to the latest version of Splunk (it works on 9.1.0.2, but not on 8.2.2.1)

tudorex5
Explorer

It's going to be a while until it's updated on my end, but I'll mark the answer and reply if it doesn't work, which I hope won't be the case 😅

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...