<?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 sum http get/post/ delete in log sample? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317241#M94900</link>
    <description>&lt;P&gt;Total Get =4&lt;BR /&gt;&lt;BR /&gt;
Total Post = 10&lt;BR /&gt;
Total PUT=30&lt;/P&gt;

&lt;P&gt;Log files example&lt;BR /&gt;
index=index1&lt;BR /&gt;
2017-04-08, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST", &lt;BR /&gt;
2017-04-03, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST", &lt;BR /&gt;
2017-04-02, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST",&lt;/P&gt;

&lt;P&gt;index=index2&lt;BR /&gt;
2017-03-03, logger="test2", AppId="200",", , accept="", contentType="application/json", requestURI="/employee/1234", httpMethod="GET",&lt;/P&gt;

&lt;P&gt;index=index3&lt;BR /&gt;
2017-02-01, logger="test1, AppId="300",", httpPort="8443", accept="", contentType="application/json", contentLength="267", requestURI="/employee/create", httpMethod="PUT",&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 18:17:01 GMT</pubDate>
    <dc:creator>jw44250</dc:creator>
    <dc:date>2017-04-10T18:17:01Z</dc:date>
    <item>
      <title>how to sum http get/post/ delete in log sample?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317241#M94900</link>
      <description>&lt;P&gt;Total Get =4&lt;BR /&gt;&lt;BR /&gt;
Total Post = 10&lt;BR /&gt;
Total PUT=30&lt;/P&gt;

&lt;P&gt;Log files example&lt;BR /&gt;
index=index1&lt;BR /&gt;
2017-04-08, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST", &lt;BR /&gt;
2017-04-03, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST", &lt;BR /&gt;
2017-04-02, logger="test1, AppId="100",", httpPort="8443", accept="", contentType="application/json", requestURI="/employees", httpMethod="POST",&lt;/P&gt;

&lt;P&gt;index=index2&lt;BR /&gt;
2017-03-03, logger="test2", AppId="200",", , accept="", contentType="application/json", requestURI="/employee/1234", httpMethod="GET",&lt;/P&gt;

&lt;P&gt;index=index3&lt;BR /&gt;
2017-02-01, logger="test1, AppId="300",", httpPort="8443", accept="", contentType="application/json", contentLength="267", requestURI="/employee/create", httpMethod="PUT",&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 18:17:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317241#M94900</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-04-10T18:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum http get/post/ delete in log sample?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317242#M94901</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2) OR (index=index3 sourcetype=sourcetype3)
| stats count by httpMethod 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317242#M94901</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-10T19:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum http get/post/ delete in log sample?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317243#M94902</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks...it would work..but my logs are different for each index ..&lt;BR /&gt;
i can do something like &lt;/P&gt;

&lt;P&gt;i was planning to do something like since the index result logs vary.. index=A | stats count by sourcetype | append [search index=B | stats count by sourcetype]&lt;/P&gt;

&lt;P&gt;One more thing : i was trying to get full text from message below: &lt;/P&gt;

&lt;P&gt;"exception(?\s\w+\s\w+)"  --&amp;gt; result hello test but no acception, but i want full "exception hello test"  whole text or statement&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317243#M94902</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-04-10T19:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum http get/post/ delete in log sample?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317244#M94903</link>
      <description>&lt;P&gt;If you want it by sourcetype, just simple add the sourcetype in the by clause of the stats. Or event better use chart so you get nice table with httpMethod as columns, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2) OR (index=index3 sourcetype=sourcetype3)
 | chart count by sourcetype httpMethod 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get the &lt;CODE&gt;exception&lt;/CODE&gt; string also part of your field value, add it inside the capturing group.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex  "(?&amp;lt;yourfieldname&amp;gt;exception\s\w+\s\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:34:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317244#M94903</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-10T19:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum http get/post/ delete in log sample?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317245#M94904</link>
      <description>&lt;P&gt;Thanks it worked.. actually I did exactly..&lt;/P&gt;

&lt;P&gt;Now i'm facing this issue how extract another event from the same log file and a called yourfieldname 2&lt;/P&gt;

&lt;P&gt;rex  "(?exception\s\w+\s\w+)"  yourfieldname 1&lt;/P&gt;

&lt;P&gt;rex  "(?Message\s\w+\s\w+)"   yourfieldname 2&lt;/P&gt;

&lt;P&gt;but if i use pipe it will not works.&lt;/P&gt;

&lt;P&gt;extracting multiple fields from the same index but differnet events&lt;BR /&gt;
message 1 event1 &lt;BR /&gt;
message 2 event 2&lt;BR /&gt;
etc&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-http-get-post-delete-in-log-sample/m-p/317245#M94904</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-04-10T19:54:47Z</dc:date>
    </item>
  </channel>
</rss>

