<?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 search the count of emails sent between two addresses using mailto and mailfrom fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265245#M79735</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to count the number of emails by couples.&lt;BR /&gt;
For example:&lt;BR /&gt;
A sent 2 emails to B&lt;BR /&gt;
B sent 1 email to A&lt;BR /&gt;
B sent 1 email to C&lt;/P&gt;

&lt;P&gt;I would like to get a table with:&lt;/P&gt;

&lt;P&gt;A &amp;lt;--&amp;gt; B : 3&lt;BR /&gt;
B &amp;lt;--&amp;gt; C : 1&lt;/P&gt;

&lt;P&gt;I have the fields: &lt;STRONG&gt;mailto&lt;/STRONG&gt; and &lt;STRONG&gt;mailfrom&lt;/STRONG&gt;.&lt;BR /&gt;
If I do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count by mailto,mailfrom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get:&lt;BR /&gt;
A --&amp;gt; B : 2&lt;BR /&gt;
B --&amp;gt; A : 1&lt;BR /&gt;
B --&amp;gt; C : 1&lt;/P&gt;

&lt;P&gt;How can I avoid this ?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 11:11:59 GMT</pubDate>
    <dc:creator>ctaf</dc:creator>
    <dc:date>2015-12-07T11:11:59Z</dc:date>
    <item>
      <title>How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265245#M79735</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to count the number of emails by couples.&lt;BR /&gt;
For example:&lt;BR /&gt;
A sent 2 emails to B&lt;BR /&gt;
B sent 1 email to A&lt;BR /&gt;
B sent 1 email to C&lt;/P&gt;

&lt;P&gt;I would like to get a table with:&lt;/P&gt;

&lt;P&gt;A &amp;lt;--&amp;gt; B : 3&lt;BR /&gt;
B &amp;lt;--&amp;gt; C : 1&lt;/P&gt;

&lt;P&gt;I have the fields: &lt;STRONG&gt;mailto&lt;/STRONG&gt; and &lt;STRONG&gt;mailfrom&lt;/STRONG&gt;.&lt;BR /&gt;
If I do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count by mailto,mailfrom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get:&lt;BR /&gt;
A --&amp;gt; B : 2&lt;BR /&gt;
B --&amp;gt; A : 1&lt;BR /&gt;
B --&amp;gt; C : 1&lt;/P&gt;

&lt;P&gt;How can I avoid this ?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 11:11:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265245#M79735</guid>
      <dc:creator>ctaf</dc:creator>
      <dc:date>2015-12-07T11:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265246#M79736</link>
      <description>&lt;P&gt;This is a bit hacky but it should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval conversation=mvjoin(mvsort(mvappend(mailto,mailfrom)), " &amp;lt;--&amp;gt; ") | stats count by conversation
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Dec 2015 12:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265246#M79736</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-07T12:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265247#M79737</link>
      <description>&lt;P&gt;The idea is good but I still get 2 differents lines for the same conversation:&lt;/P&gt;

&lt;P&gt;conversation    count&lt;BR /&gt;
A &amp;lt;--&amp;gt; B            2&lt;BR /&gt;
B &amp;lt;--&amp;gt; A            1 &lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265247#M79737</guid>
      <dc:creator>ctaf</dc:creator>
      <dc:date>2015-12-07T13:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265248#M79738</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Just tested @jplumsdaine22 query on my ES Cloud instance and it works fine. I'll copy and paste the whole thing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype="stream:smtp" earliest=-1d
| eval conversation=mvjoin(mvsort(mvappend(sender,receiver)), " &amp;lt;--&amp;gt; ")
| stats count by conversation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Keep in mind you might need to split your mailto field first if it contains multiple comma-separated values, but other than that the query works fine.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265248#M79738</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2015-12-07T13:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265249#M79739</link>
      <description>&lt;P&gt;Hello. Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search|eval couple=if((mailfrom="A" AND mailto="B") OR (mailfrom="B" AND mailto="A"),"AB",if((mailfrom="B" AND mailto="C") OR (mailfrom="C" AND mailto="B"),"BC",if((mailfrom="A" AND mailto="C") OR (mailfrom="C" AND mailto="C"),"AC",0)))|stats count  by couple
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265249#M79739</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-12-07T13:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265250#M79740</link>
      <description>&lt;P&gt;Oh my bad, it was a case sensitive problem. I just added&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| eval mailfrom=lower(mailfrom) | eval mailto=lower(mailto)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And it works fine. Thank you guys !&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 14:07:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265250#M79740</guid>
      <dc:creator>ctaf</dc:creator>
      <dc:date>2015-12-07T14:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count of emails sent between two addresses using mailto and mailfrom fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265251#M79741</link>
      <description>&lt;P&gt;This is not a very flexible solution..&lt;BR /&gt;
But thank you anyway !&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 14:08:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-of-emails-sent-between-two-addresses/m-p/265251#M79741</guid>
      <dc:creator>ctaf</dc:creator>
      <dc:date>2015-12-07T14:08:31Z</dc:date>
    </item>
  </channel>
</rss>

