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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...