<?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: Need help with regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45336#M10735</link>
    <description>&lt;P&gt;Oh. I get it now what you meant. Any idea on how to approach this?&lt;/P&gt;</description>
    <pubDate>Mon, 26 Nov 2012 20:21:57 GMT</pubDate>
    <dc:creator>theouhuios</dc:creator>
    <dc:date>2012-11-26T20:21:57Z</dc:date>
    <item>
      <title>Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45330#M10729</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I am trying to get the browser information from the below raw data and haven't been able to do so. Can anyone please explain how to get the information? I haven't yet been able to successfully write complex regex expressions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2012-11-26 19:41:42  10.64.182.218 GET /_js/mbox.js - 80 - 10.64.182.224 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+InfoPath.2;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+MS-RTC+LM+8;+.NET4.0C;+.NET4.0E)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;theou&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 19:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45330#M10729</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-11-26T19:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45331#M10730</link>
      <description>&lt;P&gt;Which info do you want? The whole user-agent string?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 19:59:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45331#M10730</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-26T19:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45332#M10731</link>
      <description>&lt;P&gt;Nope. Just the browser info. In this data only Mozilla.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 20:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45332#M10731</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-11-26T20:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45333#M10732</link>
      <description>&lt;P&gt;You do know that pretty much all browsers use "Mozilla" in their user-agent string? &lt;A href="http://en.wikipedia.org/wiki/User_agent#Format"&gt;http://en.wikipedia.org/wiki/User_agent#Format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 20:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45333#M10732</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-26T20:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45334#M10733</link>
      <description>&lt;P&gt;That's fine. In the whole raw data there are few in Opera and Internet Browser too. I just need to make a table to determine which browsers where the most used.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 20:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45334#M10733</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-11-26T20:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45335#M10734</link>
      <description>&lt;P&gt;That's my point - if you just catch the initial "Mozilla" you won't be able to differentiate between browsers at all. Both Opera and Internet Explorer commonly use "Mozilla" at the beginning of their user-agent string.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 20:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45335#M10734</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-26T20:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45336#M10735</link>
      <description>&lt;P&gt;Oh. I get it now what you meant. Any idea on how to approach this?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 20:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45336#M10735</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2012-11-26T20:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45337#M10736</link>
      <description>&lt;P&gt;Sorry, the task of making sense out of user agent strings is ridiculously complex, because there's simply no universal standard for how they're formatted. The web analytics app might have some inbuilt support for this.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 21:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45337#M10736</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-26T21:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45338#M10737</link>
      <description>&lt;P&gt;This app could very well be exactly what you're looking for. &lt;A href="http://splunk-base.splunk.com/apps/48017/ta-uas_parser"&gt;http://splunk-base.splunk.com/apps/48017/ta-uas_parser&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 21:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45338#M10737</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-26T21:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45339#M10738</link>
      <description>&lt;P&gt;I couldn't find a definitive list of permissible characters for user agent strings.  So, as long as all log entries are the same you can try this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\S*$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That just means anything that's not a space at the end of the log entry.  Since the parts of the log entry are delineated by spaces, you should be good to go with that.  Otherwise you can try something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Mozilla[\.\d\w:;+/()-]*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which is "Mozilla" followed by all the characters I found in example user agent strings.  Also, try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Mozilla[^\s]*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which just means anything not a space following "Mozilla".&lt;/P&gt;

&lt;P&gt;Regex is complicated but powerful, its worth learning.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 21:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex/m-p/45339#M10738</guid>
      <dc:creator>tpederson</dc:creator>
      <dc:date>2012-11-26T21:34:35Z</dc:date>
    </item>
  </channel>
</rss>

