Splunk Search

Character format conversion

jcisha
Path Finder

I search characters in the format you want to convert.

Characters in the form of six-digit "0" "000000" and want to convert to.
ex)
Source: "1", convert: "000001"
Source: "2", convert: "000002"

Many ways tried to think, but can not get the results.
Please help me.

0 Karma

erick_costa
Path Finder

Hi,

This should help:

| eval y = tostring( Source ) | eval x="00000" | strcat x "0" y z | eval w=substr(z, -6) | table w

jcisha
Path Finder

Thank you, and I want to solve the problem.
Use the Format function if it would have been better.

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