Dashboards & Visualizations

How to get data to appear on a graph after adding the "%" character to numeric results?

abhayneilam
Contributor

Hi,

I have a search which is showing the percentage of success and failure, but when I am adding "%" sign along with the numbers, I am not able to see the graph as this becomes a string.

| eval Field_one=round((Failure/Total)*100,2)." %" | eval Field_two=round((Success/Total)*100,2). " %" | .....

Now that "%" is added to both fields, it is causing the graph to not be shown and there is no data displayed for these two fields. When I remove "%" I am able to see the data on the graph.

My requirement is to see the numbers with % sign in the dashboard.

Please help !!

somesoni2
Revered Legend

Graphs shows only the numerical values. Once you add "%" to the values, it becomes a string. workaround could be to put an indicator in the legends (field names) OR axis titles to denote that graph shows percentage.

gfuente
Motivator

Instead of eval, try fieldformat,

http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Fieldformat

eval changes the fieldtype from numeric to string. fieldformat changes the visual representation, but the underlying value remains numeric.

0 Karma

abhayneilam
Contributor

I have used fieldformat Field_One=tostring(Field_One) + "%" also but again in the number it is showing % but in the visualization it is not showing the graph .

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...