github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/conv_traceid_w3c_to_dd.en.md (about)

     1  ### `conv_traceid_w3c_to_dd()`  {#fn-conv-traceid-w3c-to-dd}
     2  
     3  Function prototype: `fn conv_traceid_w3c_to_dd(key)`
     4  
     5  Function description: Convert a hex-encoded 128-bit/64-bit W3C Trace ID string(length 32 characters or 16 characters) to a decimal-encoded 64-bit DataDog Trace ID string.
     6  
     7  Function parameters:
     8  
     9  - `key`: 128-bit/64-bit Trace ID to convert
    10  
    11  Example:
    12  
    13  ```python
    14  
    15  # script input:
    16  
    17  "18962fdd9eea517f2ae0771ea69d6e16"
    18  
    19  # script:
    20  
    21  grok(_, "%{NOTSPACE:trace_id}")
    22  
    23  conv_traceid_w3c_to_dd(trace_id)
    24  
    25  # result:
    26  
    27  {
    28      "trace_id": "3089600317904219670",
    29  }
    30  
    31  ```