<?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 How to write a regular expression to extract and count the number of calls per URL from Apache web access logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-and-count-the/m-p/338428#M100378</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to analyse the Apache web access logs for the below textpayload:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP -- [Date +0000] "POST /PATH/URI/ HTTP/1.1" 200 1.599 0 "https://URL/to/PAGES.html" "Mozilla/5.0 (

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0" "IP, IP" Correlation-ID="10 Digit number"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, I want to get a number of calls per URL. Here calls are "&lt;A href="https://URL/to/PAGES.html"&gt;https://URL/to/PAGES.html&lt;/A&gt;" and URL is /PATH/URI/ HTTP/1.1 , Any help is highly appreciated.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2018 19:13:47 GMT</pubDate>
    <dc:creator>macadminrohit</dc:creator>
    <dc:date>2018-01-29T19:13:47Z</dc:date>
    <item>
      <title>How to write a regular expression to extract and count the number of calls per URL from Apache web access logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-and-count-the/m-p/338428#M100378</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to analyse the Apache web access logs for the below textpayload:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP -- [Date +0000] "POST /PATH/URI/ HTTP/1.1" 200 1.599 0 "https://URL/to/PAGES.html" "Mozilla/5.0 (

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0" "IP, IP" Correlation-ID="10 Digit number"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, I want to get a number of calls per URL. Here calls are "&lt;A href="https://URL/to/PAGES.html"&gt;https://URL/to/PAGES.html&lt;/A&gt;" and URL is /PATH/URI/ HTTP/1.1 , Any help is highly appreciated.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 19:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-and-count-the/m-p/338428#M100378</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-01-29T19:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a regular expression to extract and count the number of calls per URL from Apache web access logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-and-count-the/m-p/338429#M100379</link>
      <description>&lt;P&gt;Below is an example to get you going....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _raw = CASE ( count=1,"IP -- [Date +0000] \"POST /PATH/URI/ HTTP/1.1\" 200 1.599 0 \"https://URL/to/PAGES.html\" \"Mozilla/5.0 ( Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0\" \"IP, IP\" Correlation-ID=\"10 Digit number\"", count=2,"IP -- [Date +0000] \"POST /PATH/URI/ HTTP/1.1\" 200 1.599 0 \"https://URL/to/PAGES2.html\" \"Mozilla/5.0 (Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0\" \"IP, IP\" Correlation-ID=\"10 Digit number\"") 
| rex field=_raw "[^\"]*\"[^\"]*\"[^\"]*\"(?&amp;lt;url&amp;gt;[^\"]*)" 
| stats count by url
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might also want to consider looking at &lt;A href="https://splunkbase.splunk.com/app/3186/"&gt;Splunk Add-on for Apache Web Server&lt;/A&gt;  which contains pre-canned fields extractions for apache logs&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 14:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-regular-expression-to-extract-and-count-the/m-p/338429#M100379</guid>
      <dc:creator>msivill_splunk</dc:creator>
      <dc:date>2018-01-30T14:46:48Z</dc:date>
    </item>
  </channel>
</rss>

