<?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 get a log pattern count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265693#M79851</link>
    <description>&lt;P&gt;I figured out what I looking for in a different way. Here is my solution. I got the serviceName and the count by below search query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;base search | rex "requrl : serviceName: (?&amp;lt;ServiceName&amp;gt;[^\s]+)" | stats count by ServiceName&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2016 18:09:15 GMT</pubDate>
    <dc:creator>srinij</dc:creator>
    <dc:date>2016-10-19T18:09:15Z</dc:date>
    <item>
      <title>How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265685#M79843</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a log pattern like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;requrl : serviceName: abcd key: xyz-abc-def header: http
requrl : serviceName: efgh key: abc-asd-sssd header: http
requrl : serviceName: 1234 key: abc-1234-sssd header: http
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to find the unique pattern on the above. The above pattern can be duplicated - like the first line can be multiple times.&lt;/P&gt;

&lt;P&gt;For example, I would need a table which says&lt;/P&gt;

&lt;P&gt;serviceName  key&lt;BR /&gt;&lt;BR /&gt;
abcd                 xyz-abc-def&lt;BR /&gt;
efgh                 abc-asd-sssd&lt;BR /&gt;
1234                abc-1234-sssd&lt;/P&gt;

&lt;P&gt;How would i do that? Can anyone help me here?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 16:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265685#M79843</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T16:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265686#M79844</link>
      <description>&lt;P&gt;Hi @srinij - It looks like your post is missing information. You mention, "I would like to find the unique pattern like this" and nothing else is written. You will likely need to provide more information to the Answers community about what you would want your expected result to look like so that users can better help you. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265686#M79844</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2016-10-19T17:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265687#M79845</link>
      <description>&lt;P&gt;Hi Srini.. please update us some more info..what is the unique pattern on this above log pattern..&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265687#M79845</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-19T17:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265688#M79846</link>
      <description>&lt;P&gt;@aaraneta - I just added more information. sorry about that!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265688#M79846</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T17:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265689#M79847</link>
      <description>&lt;P&gt;Hi Sekar, I just updated the info!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265689#M79847</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T17:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265690#M79848</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a log pattern like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;requrl : serviceName: **abcd** key: **xyz-abc-def** header: http
requrl : serviceName: **efgh** key: **abc-asd-sssd** header: http
requrl : serviceName: **1234** key: **abc-1234-sssd** header: http
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above log lines follow the pattern - requrl : serviceName: **** key: **** header: http&lt;BR /&gt;
The bold items are values that changes.&lt;/P&gt;

&lt;P&gt;I would like to find the unique pattern on the above. The above pattern can be duplicated - like the first line can be multiple times.&lt;/P&gt;

&lt;P&gt;I would need a table which prints that serviceName and key. Also would like to ignore the duplicate entries.So, if the same line prints in the log multiple time, i would like to have only one entry in the table.&lt;/P&gt;

&lt;P&gt;serviceName  key&lt;BR /&gt;&lt;BR /&gt;
abcd                 xyz-abc-def&lt;BR /&gt;
efgh                 abc-asd-sssd&lt;BR /&gt;
1234                abc-1234-sssd&lt;/P&gt;

&lt;P&gt;How would i do that? Can anyone help me here?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265690#M79848</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T17:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265691#M79849</link>
      <description>&lt;P&gt;Assuming your data is indexed in splunk, you can use &lt;CODE&gt;extract and dedup&lt;/CODE&gt; to get your desired results. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | extract pairdelim=" " kvdelim=":" | table serviceName key | dedup serviceName key
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265691#M79849</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-19T17:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265692#M79850</link>
      <description>&lt;P&gt;That didn't work for me for some reason but it was a good one that helped learn about it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 18:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265692#M79850</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T18:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265693#M79851</link>
      <description>&lt;P&gt;I figured out what I looking for in a different way. Here is my solution. I got the serviceName and the count by below search query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;base search | rex "requrl : serviceName: (?&amp;lt;ServiceName&amp;gt;[^\s]+)" | stats count by ServiceName&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 18:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265693#M79851</guid>
      <dc:creator>srinij</dc:creator>
      <dc:date>2016-10-19T18:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a log pattern count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265694#M79852</link>
      <description>&lt;P&gt;Try this if you want both the serviceName and the key:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex "requrl : serviceName:\s(?&amp;lt;serviceName&amp;gt;[^\s]+)\skey:\s(?&amp;lt;key&amp;gt;[^\s]+)" | stats count by serviceName, key | fields serviceName, key
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2016 01:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-log-pattern-count/m-p/265694#M79852</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-10-20T01:20:03Z</dc:date>
    </item>
  </channel>
</rss>

