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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...