<?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 edit my regular expression to extract these fields from my sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247018#M73641</link>
    <description>&lt;P&gt;BINGO!!!!   Many thanks!!!!&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2016 22:16:57 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2016-10-13T22:16:57Z</dc:date>
    <item>
      <title>How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247012#M73635</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the below data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10.210.192.15 - - [12/Oct/2016:19:59:43 -0400] "GET /rest/icontrol/login?expand=sites,instances,points,functions HTTP/1.1" 401 6 "-" "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-G920A Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.124 Mobile Safari/537.36"

10.210.192.5 - - [12/Oct/2016:19:50:06 -0400] "GET /rest/icontrol/login?expand=sites,instances,points,functions HTTP/1.1" 401 6 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I'm trying to match on the OS for Android or the iPhone.  I have this much of the regex  &lt;CODE&gt;(Android|iPhone) (?P&amp;lt;os&amp;gt;)&lt;/CODE&gt;  but I'm now stumped as to what the remaining portion should be.  I need to capture 6.0.1 from the first line and 10_0_2 from the second line.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247012#M73635</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2020-09-29T11:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247013#M73636</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex  "((Android)|(iPhone OS)) (?&amp;lt;os&amp;gt;[^\s\;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2016 22:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247013#M73636</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-13T22:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247014#M73637</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/r/oeF93v/1"&gt;https://regex101.com/r/oeF93v/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 22:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247014#M73637</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-10-13T22:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247015#M73638</link>
      <description>&lt;P&gt;Hey Somesoni2!&lt;/P&gt;

&lt;P&gt;Close, that grabs the second line 10_0_2 but not the first line 6.0.1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247015#M73638</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2020-09-29T11:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247016#M73639</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yes I'm already using that site but still stumped.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 22:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247016#M73639</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-13T22:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247017#M73640</link>
      <description>&lt;P&gt;How about now?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 22:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247017#M73640</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-13T22:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247018#M73641</link>
      <description>&lt;P&gt;BINGO!!!!   Many thanks!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 22:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247018#M73641</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-13T22:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regular expression to extract these fields from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247019#M73642</link>
      <description>&lt;P&gt;You do not need it inner parentheses, and you do not need to escape the &lt;CODE&gt;;&lt;/CODE&gt;, so this should do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | rex  "(Android|iPhone OS) (?&amp;lt;os&amp;gt;[^\s;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2016 06:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regular-expression-to-extract-these-fields-from/m-p/247019#M73642</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2016-10-14T06:19:08Z</dc:date>
    </item>
  </channel>
</rss>

