Splunk Search

string to number conversion

kumar518g
Explorer

Hi All,
i have to convert an extracted field "responcetime" values like ":1389 ms",":345 ms" to number format .as the above field is of type as string its doing sorting as string but want it as number sorting so please help me.

Thanks in advance
Ravi

0 Karma
1 Solution

Ayn
Legend

Just make sure that the "responcetime" field only holds numbers, and Splunk should handle it numerically automatically. For instance you could use rex.

... | rex field=responcetime "^:(?<responcetime>\d+)" | ...

View solution in original post

Ayn
Legend

Just make sure that the "responcetime" field only holds numbers, and Splunk should handle it numerically automatically. For instance you could use rex.

... | rex field=responcetime "^:(?<responcetime>\d+)" | ...

kumar518g
Explorer

Thank u so much Ayn its worked perfectly now.
Regards
Ravi

0 Karma
Get Updates on the Splunk Community!

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

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...