<?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: How to extract a float value from 2 strings? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354743#M104979</link>
    <description>&lt;P&gt;Hello @alangularte, Can you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[\d.]*)"  max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="2018-04-21 19:57:26,189 INFO - Sat Apr 21 19:57:26 CDT 2018 ID:&amp;lt;48949.1524358646183.0&amp;gt; xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://schemas.dell.com/services/isp/assetheadersearch/03/1.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully\"&amp;gt;http://www.w3.org/2001/XMLSchema-instance\"/&amp;gt;^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully null"
| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[\d.]*)"  max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 22 Apr 2018 08:38:58 GMT</pubDate>
    <dc:creator>TISKAR</dc:creator>
    <dc:date>2018-04-22T08:38:58Z</dc:date>
    <item>
      <title>How to extract a float value from 2 strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354740#M104976</link>
      <description>&lt;P&gt;How can I get all the float values that are between the strings "totalElapsedTime^" and "^" from the log sample bellow?&lt;/P&gt;

&lt;P&gt;2018-04-21 19:57:26,189 INFO  -     Sat Apr 21 19:57:26 CDT 2018    ID:&amp;lt;48949.1524358646183.0&amp;gt; xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:ns="&lt;A href="http://schemas.dell.com/services/isp/assetheadersearch/03/1.0"&gt;http://schemas.dell.com/services/isp/assetheadersearch/03/1.0&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns:env="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:SOAP-ENV="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance%22/%3E%5EtotalElapsedTime%5E0.74%5ECallElapsedTime%5E0.67%5ERequestPipelineElapsedTime%5E0.02%5EResponsePipelineElapsedTime%5E0.04%5ERequestTransformationElapsedTime%5E0%5EResponseTransformationElapsedTime%5E0.04%5EpayloadSize%5E1047%5EappName%5E%5EResult%5ECompletedSuccessfully"&gt;http://www.w3.org/2001/XMLSchema-instance"/&amp;gt;^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully&lt;/A&gt;    null&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 03:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354740#M104976</guid>
      <dc:creator>alangularte</dc:creator>
      <dc:date>2018-04-22T03:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a float value from 2 strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354741#M104977</link>
      <description>&lt;P&gt;@alangularte, please try out the following rex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;yourBaseSearch&amp;gt;
| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[^\^]+)\^" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search based on the the sample data provided:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="2018-04-21 19:57:26,189 INFO - Sat Apr 21 19:57:26 CDT 2018 ID:&amp;lt;48949.1524358646183.0&amp;gt; xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://schemas.dell.com/services/isp/assetheadersearch/03/1.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully\"&amp;gt;http://www.w3.org/2001/XMLSchema-instance\"/&amp;gt;^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully null"
| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[^\^]+)\^" max_match=0
| table totalElapsedTime _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Apr 2018 05:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354741#M104977</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-22T05:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a float value from 2 strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354742#M104978</link>
      <description>&lt;P&gt;Looks like you basically just need a rex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=0 "\^(?&amp;lt;fieldname&amp;gt;\w+)\^(?&amp;lt;fieldvalue&amp;gt;[0-9.]+)(?=\^)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will extract every copy into two multivalue fields.  I'm not clear whether your example is two different events, or if you needed the first or second set of data.  If you need both, then you have an ambiguity issue due to repeating the same names.&lt;/P&gt;

&lt;P&gt;The next step would be stitching each pair together and then using &lt;CODE&gt;mvexpand&lt;/CODE&gt; to create single records, then assigning the fieldvalues  to the fieldnames.  &lt;/P&gt;

&lt;P&gt;I'll hold off making code for that until you describe what you need to do with the data.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 05:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354742#M104978</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-04-22T05:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a float value from 2 strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354743#M104979</link>
      <description>&lt;P&gt;Hello @alangularte, Can you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[\d.]*)"  max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="2018-04-21 19:57:26,189 INFO - Sat Apr 21 19:57:26 CDT 2018 ID:&amp;lt;48949.1524358646183.0&amp;gt; xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://schemas.dell.com/services/isp/assetheadersearch/03/1.0\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully\"&amp;gt;http://www.w3.org/2001/XMLSchema-instance\"/&amp;gt;^totalElapsedTime^0.74^CallElapsedTime^0.67^RequestPipelineElapsedTime^0.02^ResponsePipelineElapsedTime^0.04^RequestTransformationElapsedTime^0^ResponseTransformationElapsedTime^0.04^payloadSize^1047^appName^^Result^CompletedSuccessfully null"
| rex "totalElapsedTime\^(?&amp;lt;totalElapsedTime&amp;gt;[\d.]*)"  max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Apr 2018 08:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-float-value-from-2-strings/m-p/354743#M104979</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-22T08:38:58Z</dc:date>
    </item>
  </channel>
</rss>

