Splunk Search

How to Add percentage to Column?

woodlandrelic
Path Finder

Hi
I am trying to add % to the "by percent" column only.  I can't seem to get it to show.

Thanks

 

Screenshot (21).png

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

gcusello
SplunkTrust
SplunkTrust

Hi @woodlandrelic,

please next time, add to your question also the code in text format (using the Insert/Edit Code Sample button), so we don't have to rewrite the code!

Anyway,, before the table command you should add an eval command like the following

<your_search>
| eval HBSS=HBSS."%", ACAS=ACAS."%"

if you want you could also round the results e.f. to the second decimal:

<your_search>
| eval HBSS=round(HBSS,2)."%", ACAS=round(ACAS,2)."%"

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @woodlandrelic,

please next time, add to your question also the code in text format (using the Insert/Edit Code Sample button), so we don't have to rewrite the code!

Anyway,, before the table command you should add an eval command like the following

<your_search>
| eval HBSS=HBSS."%", ACAS=ACAS."%"

if you want you could also round the results e.f. to the second decimal:

<your_search>
| eval HBSS=round(HBSS,2)."%", ACAS=round(ACAS,2)."%"

Ciao.

Giuseppe

woodlandrelic
Path Finder

Hi @gcusello

 My apologies, I will do that next time.
This is how I got it to work because I needed to still divide by "dnsName"

| eval HBSS=round(HBSS/dnsName*100)."%"

   Thank you

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @woodlandrelic ,

good for you, you're always welcome! see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

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