<?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 Re: Removing leading and trailing symbols from a string for numeric conversion in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455457#M170539</link>
    <description>&lt;P&gt;Thanks. It worked&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 16:34:18 GMT</pubDate>
    <dc:creator>bonddodla</dc:creator>
    <dc:date>2019-07-03T16:34:18Z</dc:date>
    <item>
      <title>Removing leading and trailing symbols from a string for numeric conversion</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455455#M170537</link>
      <description>&lt;P&gt;I have a field Threshold which has a value "+-5%", "&amp;gt;20%", "&amp;lt;30%" etc, which i want to convert into a number.&lt;/P&gt;

&lt;P&gt;Could you please suggest how can i remove the leading and trailing symbols so that i can achieve the numeric value only.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 08:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455455#M170537</guid>
      <dc:creator>bonddodla</dc:creator>
      <dc:date>2019-07-03T08:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Removing leading and trailing symbols from a string for numeric conversion</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455456#M170538</link>
      <description>&lt;P&gt;@bonddodla try the following rex command on your &lt;CODE&gt;Threshold&lt;/CODE&gt; field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="Threshold" "(?&amp;lt;Threshold&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example based on sample data provided in the question&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval Threshold="+-5%,&amp;gt;20%,&amp;lt;30%"
| makemv Threshold delim=","
| mvexpand Threshold
| rex field="Threshold" "(?&amp;lt;Threshold&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 11:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455456#M170538</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-07-03T11:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Removing leading and trailing symbols from a string for numeric conversion</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455457#M170539</link>
      <description>&lt;P&gt;Thanks. It worked&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 16:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-leading-and-trailing-symbols-from-a-string-for-numeric/m-p/455457#M170539</guid>
      <dc:creator>bonddodla</dc:creator>
      <dc:date>2019-07-03T16:34:18Z</dc:date>
    </item>
  </channel>
</rss>

