<?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 do I extract these two fields from a string in my sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215027#M63040</link>
    <description>&lt;P&gt;Hello !&lt;/P&gt;

&lt;P&gt;thank you, all seems to work.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2016 09:00:39 GMT</pubDate>
    <dc:creator>fbertoletti</dc:creator>
    <dc:date>2016-04-27T09:00:39Z</dc:date>
    <item>
      <title>How do I extract these two fields from a string in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215025#M63038</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have this logs :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Apr 26 12:49:09 10.30.245.203 Apr 26 14:49:12 MachineOne info tmm1[11869]: Rule /User_Agent &amp;lt;HTTP_RESPONSE&amp;gt;: src_ip=112.43.9.4,vip=110.12.8.8,http_method=GET,http_host=www.xxxx.it:443,http_uri=/files/visio.jpg,http_url=www.xxx.it:443/files/x/x/x/x/x.jpg,http_version=1.1,http_user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36",http_content_type=,http_referrer="https://x/",req_start_time=2016/04/26 14:49:12,cookie="_x",user=,virtual_server="/x x x",bytes_in=0,res_start_time=2016/04/26 14:49:12,node=x ,node_port=80,http_status=200,req_elapsed_time=5,bytes_out=13290 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to only extract this part &lt;CODE&gt;Windows NT 6.1&lt;/CODE&gt; and &lt;CODE&gt;Chrome/49.0.2623.112&lt;/CODE&gt;  in the &lt;STRONG&gt;http_user_agent&lt;/STRONG&gt; field.&lt;/P&gt;

&lt;P&gt;I also have another log with the values&lt;CODE&gt;Linux&lt;/CODE&gt; and &lt;CODE&gt;Chrome/49.0.2623.105&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Apr 26 13:10:16 10.30.245.203 Apr 26 15:10:19 x info tmm[11869]: Rule /User_Agent &amp;lt;HTTP_RESPONSE&amp;gt;: src_ip=x,vip=x8,http_method=GET,http_host=x,http_uri=x,http_url=x,http_version=1.1,http_user_agent="Mozilla/5.0 (**Linux**; Android 4.4.2; LG-D213 Build/KOT49I.A1407976057) AppleWebKit/537.36 (KHTML, like Gecko) **Chrome/49.0.2623.105** Mobile Safari/537.36",http_content_type=,http_referrer="x",req_start_time=2016/04/26 15:10:19,cookie="x",user=,vir
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to use regex, but without the expected result.&lt;/P&gt;

&lt;P&gt;Objective is to have table with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;OS                  Nav
Windows NT 6.1      Chrome/49.0.2623.112
Linux               Chrome/49.0.2623.10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215025#M63038</guid>
      <dc:creator>fbertoletti</dc:creator>
      <dc:date>2020-09-29T09:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract these two fields from a string in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215026#M63039</link>
      <description>&lt;P&gt;This worked for me using your sample data.  You can check other strings at regex101.com&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=http_user_agent "\((?P&amp;lt;OS&amp;gt;[^;\*]+);.*\)\s(?P&amp;lt;Nav&amp;gt;[^ \*]+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Apr 2016 16:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215026#M63039</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-04-26T16:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract these two fields from a string in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215027#M63040</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;

&lt;P&gt;thank you, all seems to work.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 09:00:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-two-fields-from-a-string-in-my-sample/m-p/215027#M63040</guid>
      <dc:creator>fbertoletti</dc:creator>
      <dc:date>2016-04-27T09:00:39Z</dc:date>
    </item>
  </channel>
</rss>

