Splunk Search

How to add certain character to a search result (Number)?

aryamehr360
New Member

I want to reformat any number of my search result to kWh ; as you see in pictures below for example 15 to 15 kWh.

alt text

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

skoelpin
SplunkTrust
SplunkTrust

You want to add text to your numerical field? If so then it would be as simple as

| eval Average-kWh=Average-kWh." kWh"

Splunk may not like the - in the field name. If it complains about this, change the name on line 7 to something like Average_kWh then rename after the eval I pasted above

View solution in original post

0 Karma

skoelpin
SplunkTrust
SplunkTrust

You want to add text to your numerical field? If so then it would be as simple as

| eval Average-kWh=Average-kWh." kWh"

Splunk may not like the - in the field name. If it complains about this, change the name on line 7 to something like Average_kWh then rename after the eval I pasted above

0 Karma

aryamehr360
New Member

Yes it work the issue was idd the - in the field name,
thanks.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...