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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...