Getting Data In

How to create new column with percentage?

SS1
Path Finder

Hi,

My search is giving below output,

Month  FieldA    FieldB
Jan         285      1410
Feb         247      1934
Mar         215      2197

Can we create a new column with FieldA% and FieldB%, below is the example

Month  FieldA    FieldB   FieldA% FieldB%
Jan         285      1410        20%           80%      
Feb         247      1934         22%          78%
Mar         215      2197         15%           85%

Eventually i will only be using Month and FieldA% in a column chart

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use eval to compute the percentage

| eval FieldApct = (FieldA*100)/(FieldA + FieldB)
| rename FieldApct as "FieldA%"

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...