Splunk Search

How to typecast an integer as a string literal

jcbrendsel
Path Finder

Is there any way to explicitly typecast a number in Splunk so that it is interpreted as a string literal rather than as a number?

IE, I want '64' to be interpreted as a string rather than as an integer.

Is this possible?

Tags (1)
1 Solution

araitz
Splunk Employee
Splunk Employee

Assuming the number is the value of an extracted field:

... | eval your_field = tostring(your_field)

This and other uses of eval can be found in the search reference:

http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions

View solution in original post

araitz
Splunk Employee
Splunk Employee

Assuming the number is the value of an extracted field:

... | eval your_field = tostring(your_field)

This and other uses of eval can be found in the search reference:

http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions

Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...