<?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: User Agent regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40095#M9223</link>
    <description>&lt;P&gt;After troubleshooting with the creator of the TA-browscap app, Dave Shpritz, for two days we finally got it figured out. The final regex ended up being; &lt;CODE&gt;\s\"(?P&amp;lt;http_user_agent&amp;gt;[^"]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The TA-browscap app supplies a lot of very useful information for the pesky user agent strings. &lt;/P&gt;

&lt;P&gt;Big thanks to Dave on this one!&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2013 20:59:32 GMT</pubDate>
    <dc:creator>dewald13</dc:creator>
    <dc:date>2013-02-22T20:59:32Z</dc:date>
    <item>
      <title>User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40089#M9217</link>
      <description>&lt;P&gt;I'm trying to create a regex to match the user agent from the following logs. Beginning with "Mozilla/*" and ending at the end of the UA string. The problem I'm having is that one is so much longer than the other one I cant seem to match them both from " to ". I know these are a pain in the @$$ to deal with but was curious if anyone had any suggestions/insight. &lt;/P&gt;

&lt;P&gt;2013-02-21 22:39:29 26 xxx 200 TCP_ACCELERATED 39 373 CONNECT tcp ssl.gstatic.com 443 / - - - - 132.x.xx.134 - "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E)" OBSERVED "Search Engines/Portals" - 1xx.xx.xx.xxx SG-HTTP-Service&lt;/P&gt;

&lt;P&gt;2013-02-21 22:39:29 26 xxx 200 TCP_ACCELERATED 39 373 CONNECT tcp ssl.gstatic.com 443 / - - - - 132.x.xx.134 - "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1" - xxx.x.xxx.xxx SG-HTTP-Service&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 02:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40089#M9217</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-02-22T02:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40090#M9218</link>
      <description>&lt;P&gt;Something like Mozilla[^"]*&lt;/P&gt;

&lt;P&gt;&lt;A href="http://regexr.com?33s70"&gt;http://regexr.com?33s70&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 04:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40090#M9218</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2013-02-22T04:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40091#M9219</link>
      <description>&lt;P&gt;That worked perfect using a regex generator online but when I put that into Splunk as a field extraction it does not match anything. Any ideas???&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 13:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40091#M9219</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-02-22T13:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40092#M9220</link>
      <description>&lt;P&gt;Good point.  Are you not used the default sourcetype for access_combined logs?  It should already have this.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
REGEX = ^[[nspaces:clientip]]\s++[[nspaces:ident]]\s++[[nspaces:user]]\s++[[sbstring:req_time]]\s++[[access-request]]\s++[[nspaces:status]]\s++&lt;A href="https://community.splunk.com/?:s++%22(?%3Creferer%3E%5B%5Bbc_domain:referer_%5D%5D?+%5B%5E%22%5D*+)%22(?:s++%5B%5Bqstring:useragent%5D%5D(?:s++%5B%5Bqstring:cookie%5D%5D)?+)?+" target="_blank"&gt;[nspaces:bytes]&lt;/A&gt;?[[all:other]]&lt;CODE&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;For some reason it is dropping the back slashes before the s'es.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40092#M9220</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2020-09-28T13:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40093#M9221</link>
      <description>&lt;P&gt;I just looked at your logs again.  I guess they are not access combined logs.  If I get some time today I will try to come up with the extractions for the whole log message.  What are these from if you don't mind me asking?&lt;/P&gt;

&lt;P&gt;I guess they are.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 14:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40093#M9221</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2013-02-22T14:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40094#M9222</link>
      <description>&lt;P&gt;They are from BlueCoats in ELFF format.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 14:38:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40094#M9222</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-02-22T14:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40095#M9223</link>
      <description>&lt;P&gt;After troubleshooting with the creator of the TA-browscap app, Dave Shpritz, for two days we finally got it figured out. The final regex ended up being; &lt;CODE&gt;\s\"(?P&amp;lt;http_user_agent&amp;gt;[^"]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The TA-browscap app supplies a lot of very useful information for the pesky user agent strings. &lt;/P&gt;

&lt;P&gt;Big thanks to Dave on this one!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 20:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40095#M9223</guid>
      <dc:creator>dewald13</dc:creator>
      <dc:date>2013-02-22T20:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: User Agent regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40096#M9224</link>
      <description>&lt;P&gt;I have been looking for this answer for a while now. The regex posted above; \s\"(?P&lt;HTTP_USER_AGENT&gt;[^"]+)&lt;BR /&gt;
does not return the user agent in apache syslog files, instead I added \" to the beginning, this way it will match the close quotes, space character and finally an open quotes, before picking up field. &lt;BR /&gt;
FINAL REGEX: &lt;CODE&gt;\"\s\"(?P&amp;lt;http_user_agent&amp;gt;[^"]+)&lt;/CODE&gt;&lt;BR /&gt;
Hope it helps,&lt;BR /&gt;
monkeymole&lt;/HTTP_USER_AGENT&gt;&lt;/P&gt;

&lt;P&gt;edit: added the final regex to the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 18:34:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-Agent-regex/m-p/40096#M9224</guid>
      <dc:creator>monkeymole</dc:creator>
      <dc:date>2013-05-07T18:34:45Z</dc:date>
    </item>
  </channel>
</rss>

