Getting Data In

Large Decimal to Hex - Loss of Precision

pagaard
Observer

Greetings,

I would like to convert a large number to hex, just as described in this post.

While the above poster's issue was resolved via printf("%X",<field>), this did not work for me with a 19 digit uint64.

. Run-anywhere example:

 

| makeresults
| eval id="6932595798699158802"
| eval want="6035872600D42D12"
| eval dataHexUsingPrintf=printf("%X",id)
| table id want dataHexUsingPrintf

 

I've tried several combinations of exact(), tostring(id, "hex"), and all attempts fail, it appears due to a lack of precision in the initial conversion to 'number' type.

Example:

| makeresults
| eval id="6932595798699158802"
| convert num(id) as id_num
| eval want="6035872600D42D12"
| eval dataHexUsingPrintf=printf("%X",id_num)

Does Splunk support big num calculations of this type?
Is there a work around I'm missing to properly convert to hex?

 

Labels (1)
Tags (2)
0 Karma
Get Updates on the Splunk Community!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...