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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

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, ...