<?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 count the number of times an event in one sourcetype is occuring in another sourcetype? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209322#M61162</link>
    <description>&lt;P&gt;As additional info, for yesterday's data, sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B only has 11 tickets. Running your answer resulted to pulling all TICKET_NUMBERs for  sourcetype=TICKET_ACTIVITY, which is 30,509 and showing the activity counts for each of these tickets.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:07:41 GMT</pubDate>
    <dc:creator>christopheryu</dc:creator>
    <dc:date>2020-09-29T11:07:41Z</dc:date>
    <item>
      <title>How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209317#M61157</link>
      <description>&lt;P&gt;I have two sourcetypes, TICKET_OPENED &amp;amp; TICKET_ACTIVITY, both of which have a common field TICKET_NUMBER. I am able to narrow my search on sourcetype TICKET_OPENED using the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index xyz sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A specific TICKET_NUMBER from sourcetype =TICKET_OPENED can have multiple activity logs in sourcetype=TICKET_ACTIVITY. How can I get the number of activity logs of a TICKET_NUMBER on sourcetype=TICKET_ACTIVITY? Please note that TICKET_ACTIVITY does not have the fields PRODUCT_TYPE &amp;amp; GROUP.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209317#M61157</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T11:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209318#M61158</link>
      <description>&lt;P&gt;It sounds like you're trying to do something like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index xyz (sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B) OR sourcetype=TICKET_ACTIVITY | stats count(TICKET_ACTIVITY)  as TICKET_ACTIVITY_COUNT by TICKET_NUMBER
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Sep 2016 21:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209318#M61158</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2016-09-21T21:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209319#M61159</link>
      <description>&lt;P&gt;Thanks for the response but it does not work. Please note that I narrowed my ticket search from sourcetype=TICKET_OPENED using the fields PRODUCT_TYPE=A GROUP=B. Sourcetype TICKET_ACTIVITY does not have these fields and it includes other tickets. Illustration below:&lt;/P&gt;

&lt;P&gt;sourcetype=TICKET_OPENED&lt;/P&gt;

&lt;P&gt;TICKET_NUMBER 01 (PRODUCT_TYPE=A GROUP=B)&lt;BR /&gt;
TICKET_NUMBER 02 (PRODUCT_TYPE=B GROUP=A)&lt;/P&gt;

&lt;P&gt;I am only looking for TICKET_NUMBER 01 (PRODUCT_TYPE=A GROUP=B) in above.&lt;/P&gt;

&lt;P&gt;I need to find how many activity logs TICKET NUMBER 01 has in sourcetype=TICKET_ACTIVITY&lt;/P&gt;

&lt;P&gt;TICKET_NUMBER 01 activity log 1&lt;BR /&gt;
TICKET_NUMBER 01 activity log 2&lt;BR /&gt;
TICKET_NUMBER 01 activity log 3&lt;BR /&gt;
TICKET_NUMBER 02 activity log 1&lt;BR /&gt;
TICKET_NUMBER 03 activity log 1&lt;BR /&gt;
TICKET_NUMBER 03 activity log 2&lt;/P&gt;

&lt;P&gt;So the result I am trying to come up with is 3 activity logs for TICKET_NUMBER 01, and eventually find the ticket activity logs stats for all TICKET_NUMBERs that belong to PRODUCT_TYPE=A GROUP=B.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209319#M61159</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T11:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209320#M61160</link>
      <description>&lt;P&gt;This should give you a count by ticket_number in ticket_activity for ticket_number that occur in both sourcetypes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B 
| stats count by TICKET_NUMBER sourcetype 
| append 
    [search index=xyz sourcetype=TICKET_ACTIVITY 
    | stats count by TICKET_NUMBER sourcetype] 
| eventstats count(sourcetype) as num by TICKET_NUMBER 
| where num=2 
| where sourcetype=TICKET_ACTIVITY
| stats count by TICKET_NUMBER
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209320#M61160</guid>
      <dc:creator>chrisduimstra</dc:creator>
      <dc:date>2020-09-29T11:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209321#M61161</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index xyz (sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B) OR sourcetype=TICKET_ACTIVITY | stats values(sourcetype) as sourcetype count(eval(sourcetype="TICKET_ACTIVITY")) as TICKET_ACTIVITY_COUNT by TICKET_NUMBER  | where mvcount(sourcetype)=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 01:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209321#M61161</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-22T01:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209322#M61162</link>
      <description>&lt;P&gt;As additional info, for yesterday's data, sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B only has 11 tickets. Running your answer resulted to pulling all TICKET_NUMBERs for  sourcetype=TICKET_ACTIVITY, which is 30,509 and showing the activity counts for each of these tickets.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209322#M61162</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T11:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209323#M61163</link>
      <description>&lt;P&gt;This search is good as it only pulls tickets from sourcetype=TICKET_ACTIVITY using the filtered tickets from sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B, however, all  TICKET_ACTIVITY_COUNTs is equal to 0.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209323#M61163</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T11:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209324#M61164</link>
      <description>&lt;P&gt;Try the updated query&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 13:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209324#M61164</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-22T13:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209325#M61165</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index xyz sourcetype=TICKET_ACTIVITY OR (sourcetype=TICKET_OPENED PRODUCT_TYPE=A GROUP=B)
| eval PRODUCT_TYPE_AND_GROUP = PRODUCT_TYPE . "::" . GROUP
| eventstats values(PRODUCT_TYPE_AND_GROUP) AS PRODUCT_TYPE_AND_GROUP BY TICKET_NUMBER
| stats count(eval(sourcetype=TICKET_ACTIVITY)) AS ticket_count BY PRODUCT_TYPE_AND_GROUP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209325#M61165</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-09-22T14:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209326#M61166</link>
      <description>&lt;P&gt;You are the man, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 15:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209326#M61166</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2016-09-22T15:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209327#M61167</link>
      <description>&lt;P&gt;Splunk message below:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: You must specify a rename for the aggregation specifier on the dynamically evaluated field 'count(eval(sourcetype=TICKET_ACTIVITY))'.&lt;/P&gt;

&lt;P&gt;and when I do a rename ... stats count(eval(sourcetype=TICKET_ACTIVITY)) AS NEW_NAME BY PRODUCT_TYPE_AND_GROUP&lt;/P&gt;

&lt;P&gt;pulls 0 events&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:07:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209327#M61167</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T11:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209328#M61168</link>
      <description>&lt;P&gt;Fixed in original answer; retry now.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209328#M61168</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-09-22T16:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of times an event in one sourcetype is occuring in another sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209329#M61169</link>
      <description>&lt;P&gt;"No results found" Got my answer though above, thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 18:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-times-an-event-in-one-sourcetype-is/m-p/209329#M61169</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2016-09-22T18:42:04Z</dc:date>
    </item>
  </channel>
</rss>

