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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...