<?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 write a search to get the total count of emails sent out and the count for each individual mail ID? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138355#M37965</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This query isn't working. total count is displayed under individual mail id's rather than their individual count.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2015 10:56:07 GMT</pubDate>
    <dc:creator>Navanitha</dc:creator>
    <dc:date>2015-06-08T10:56:07Z</dc:date>
    <item>
      <title>How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138350#M37960</link>
      <description>&lt;P&gt;I have a search which gives the total count of emails sent out from 5 different mail ids.  I use a scheduled report for this and the report has the output - Count and last email sent.  Now my requirement is along with the total count, I also need the count of emails sent from individual mail id's in my report.  So the report looks something like,&lt;BR /&gt;
                                             total  count, last email sent&lt;BR /&gt;&lt;BR /&gt;
                                             mail sent from &lt;A href="mailto:email1@x.com"&gt;email1@x.com&lt;/A&gt;=10&lt;BR /&gt;
                                             mail sent from &lt;A href="mailto:email2@y.com"&gt;email2@y.com&lt;/A&gt;=15&lt;BR /&gt;
                                             mail sent from &lt;A href="mailto:email3@z.com"&gt;email3@z.com&lt;/A&gt;=20 and so on...&lt;BR /&gt;
can someone tell me how to do this.&lt;BR /&gt;
Thank you..&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 08:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138350#M37960</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-06-08T08:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138351#M37961</link>
      <description>&lt;P&gt;Lets get your first query, giving the total count of emails sent out from 5 different mail ids, please.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 09:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138351#M37961</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-08T09:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138352#M37962</link>
      <description>&lt;P&gt;In function of the  query you gave in your coment, Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz "email1@xxx.com" OR "email2@yyy.com" OR "email3@zzz.com" OR "email4@abc.com" OR "email5@xyz.com" "ready" "MID"|eval email=case(searchmatch("email1@xxx.com"), "email1@xxx.com",searchmatch("email2@xxx.com"), "email2@xxx.com",searchmatch("email3@xxx.com"), "email3@xxx.com",searchmatch("email4@xxx.com"), "email4@xxx.com",searchmatch("email5@xxx.com"), "email5@xxx.com")|stats count as totalcount, last(_time) as EmailSent by email | convert ctime("EmailSent") as time   | table email,totalcount, time 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jun 2015 09:39:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138352#M37962</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-08T09:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138353#M37963</link>
      <description>&lt;P&gt;index=xyz  "&lt;A href="mailto:email1@xxx.com"&gt;email1@xxx.com&lt;/A&gt;" OR "&lt;A href="mailto:email2@yyy.com"&gt;email2@yyy.com&lt;/A&gt;" OR "&lt;A href="mailto:email3@zzz.com"&gt;email3@zzz.com&lt;/A&gt;" OR "&lt;A href="mailto:email4@abc.com"&gt;email4@abc.com&lt;/A&gt;"  OR "&lt;A href="mailto:email5@xyz.com"&gt;email5@xyz.com&lt;/A&gt;" "ready" "MID"|stats count, last(_time) as "EmailSent" |  convert ctime("EmailSent") as time | table count, time&lt;/P&gt;

&lt;P&gt;Looks something like this..&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 09:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138353#M37963</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-06-08T09:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138354#M37964</link>
      <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz "email1@xxx.com" OR "email2@yyy.com" OR "email3@zzz.com" OR "email4@abc.com" OR "email5@xyz.com" "ready" "MID"|stats count as "total count",count(eval("email1@xxx.com")) as "count of email1@xxx.com",count(eval("email1@yyy.com")) as "count of email1@yyy.com",count(eval("email1@xyz.com")) as "count of email1@xyz.com",count(eval("email1@abc.com")) as "count of email1@abc.com", last(_time) as "EmailSent" | convert ctime("EmailSent") as time | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz "email1@xxx.com" OR "email2@yyy.com" OR "email3@zzz.com" OR "email4@abc.com" OR "email5@xyz.com" "ready" "MID"|stats count as "total count",count(eval(mailfrom="email1@xxx.com")) as "count of email1@xxx.com",count(eval(mailfrom="email1@yyy.com")) as "count of email1@yyy.com",count(eval(mailfrom="email1@xyz.com")) as "count of email1@xyz.com",count(eval(mailfrom="email1@abc.com")) as "count of email1@abc.com", last(_time) as "EmailSent" | convert ctime("EmailSent") as time | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eventstats count as "total count" | stats count by mailfrom|....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where mailfrom={"&lt;A href="mailto:email1@xxx.com"&gt;email1@xxx.com&lt;/A&gt;" ; "&lt;A href="mailto:email2@yyy.com"&gt;email2@yyy.com&lt;/A&gt;" ;"&lt;A href="mailto:email3@zzz.com"&gt;email3@zzz.com&lt;/A&gt;" ; "&lt;A href="mailto:email4@abc.com"&gt;email4@abc.com&lt;/A&gt;" ; "&lt;A href="mailto:email5@xyz.com"&gt;email5@xyz.com&lt;/A&gt;"}&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 10:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138354#M37964</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-06-08T10:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138355#M37965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This query isn't working. total count is displayed under individual mail id's rather than their individual count.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 10:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138355#M37965</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-06-08T10:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138356#M37966</link>
      <description>&lt;P&gt;Hi Stephan,&lt;/P&gt;

&lt;P&gt;I extracted a field for address and your query worked.  But this time, it is only giving the individual counts of each email id but not getting the cumulative count(adding the all the email sent out from these mail ids) and last email sent time.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 14:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138356#M37966</guid>
      <dc:creator>Navanitha</dc:creator>
      <dc:date>2015-06-08T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to get the total count of emails sent out and the count for each individual mail ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138357#M37967</link>
      <description>&lt;P&gt;Here you go:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=xyz "email1@xxx.com" OR "email2@yyy.com" OR "email3@zzz.com" OR "email4@abc.com" OR "email5@xyz.com" "ready" "MID"|eval email=case(searchmatch("email1@xxx.com"), "email1@xxx.com",searchmatch("email2@xxx.com"), "email2@xxx.com",searchmatch("email3@xxx.com"), "email3@xxx.com",searchmatch("email4@xxx.com"), "email4@xxx.com",searchmatch("email5@xxx.com"), "email5@xxx.com")|eventstats count as Totalemail|stats count as totalcount, last(_time) as EmailSent by email | convert ctime("EmailSent") as time   | table Totalemail email,totalcount, time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But here the Totalemail value will be the same in each row&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 16:00:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-get-the-total-count-of-emails-sent-out/m-p/138357#M37967</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-08T16:00:25Z</dc:date>
    </item>
  </channel>
</rss>

