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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...