<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to convert String to Integer  search? in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-convert-String-to-Integer-search/m-p/619407#M11156</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;I have "file_size" in my&amp;nbsp; extracted fields and the values are 1.56 KB,5.03 MB, 1.06 B. and those values are strings. I need a query how to convert string to Integer to sum(file_size)&amp;nbsp; i need to use max and min and sum commands for the file_size. Please help me on the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 14:23:19 GMT</pubDate>
    <dc:creator>umesh</dc:creator>
    <dc:date>2022-11-03T14:23:19Z</dc:date>
    <item>
      <title>How to convert String to Integer  search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-convert-String-to-Integer-search/m-p/619407#M11156</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;I have "file_size" in my&amp;nbsp; extracted fields and the values are 1.56 KB,5.03 MB, 1.06 B. and those values are strings. I need a query how to convert string to Integer to sum(file_size)&amp;nbsp; i need to use max and min and sum commands for the file_size. Please help me on the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 14:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-convert-String-to-Integer-search/m-p/619407#M11156</guid>
      <dc:creator>umesh</dc:creator>
      <dc:date>2022-11-03T14:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: convert String to Integer  search</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-convert-String-to-Integer-search/m-p/619412#M11157</link>
      <description>&lt;P class="lia-align-left"&gt;Here's an example - you need the rex and eval statements&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval file_size=split("1.56 KB,5.03 MB,1.06 B,1MB,4.95 GB,5.13TB", ",")
| mvexpand file_size
| rex field=file_size "(?&amp;lt;size&amp;gt;\d+(\.\d+)?)\s?(?&amp;lt;mul&amp;gt;\w+)?"
| eval file_size=case(mul="KB", size * 1024, 
                      mul="MB", size * 1024 * 1024, 
                      mul="GB", size * 1024 * 1024 * 1024, 
                      mul="TB", size * 1024 * 1024 * 1024 * 1024,
                      1==1, size)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Nov 2022 07:24:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-convert-String-to-Integer-search/m-p/619412#M11157</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-11-03T07:24:10Z</dc:date>
    </item>
  </channel>
</rss>

