title: Is it possible to convert string values to numbers in LogQL?
body: <p>I am following <a href="https://grafana.com/docs/loki/latest/logql/" rel="noreferrer">documentation</a> and thanks to <code>| line_format</code> and <code>regexReplaceAll</code> I was able to fetch some substring from a line.</p>
  <p>Let's say now I have those columns:</p>
  <pre><code>line
  123
  7
  123
  54
  14
  </code></pre>
  <p>Having that I want to perform some transform operation, ex sum, or transform operation with grouping by and taking total.
  It is not working as I am suspecting those values are not being numbers, but only strings.
  Is it possible to convert it to numbers?</p>
  <p>I was trying using <code>unwrap</code> but it didn't worked:</p>
  <pre><code>sum_over_time(
      {service=&quot;some&quot;} 
      |=&quot;text expression&quot;
      | json
      | line_format `{{ regexReplaceAll &quot;text expression to remove from (\\d+)&quot; .label_id &quot;${1}&quot; | trim }}`
      | unwrap label_id [1m]
  )
  </code></pre>
  <p>it ends up with</p>
  <blockquote>
  <p>pipeline error: 'SampleExtractionErr' for series:</p>
  </blockquote>
  <p>when I am filtering out errors, there is no results.</p>