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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...