<?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: email filter query in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634205#M14895</link>
    <description>&lt;P&gt;in events&amp;nbsp;&lt;SPAN class=""&gt;SenderAddress is sender, in raw log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Recipient Domain is under&amp;nbsp;&lt;/SPAN&gt;INTERESTING FIELDS, which is working when using table command.&lt;/P&gt;&lt;P&gt;Please help for the last 3 lines.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 07:20:20 GMT</pubDate>
    <dc:creator>sulaimancds</dc:creator>
    <dc:date>2023-03-13T07:20:20Z</dc:date>
    <item>
      <title>Search to filter email?</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634189#M14884</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=mail
| dedup MessageTraceId
| dedup MessageId
| dedup subject
| lookup email_domain_whitelist domain AS RecipientDomain output domain as domain_match
| where isnull(domain_match)
| lookup all_email_provider_domains domain AS RecipientDomain output domain as domain_match2
| where isnotnull(domain_match2)
| table RecipientDomain SenderAddress RecipientAddress Subject Received

&lt;/LI-CODE&gt;
&lt;P&gt;hi this 3 lines are not working for this query. Please help.&lt;BR /&gt;| where mvcountRecipientAddress=1&lt;BR /&gt;| eval subject_count=mvcount(Subject)&lt;BR /&gt;| sort - subject_count&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 13:47:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634189#M14884</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T13:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634192#M14885</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first are you sure that the three dedups will correctly work?&lt;/P&gt;&lt;P&gt;are you sure that you have the correct results or that it's better to dedup for the three fields in one command?&lt;/P&gt;&lt;P&gt;Anyway, where do the fields "&lt;SPAN&gt;mvcountRecipientAddress" and "sunject" come from: the main search or the lookup? I don't see them in lookup, are you sure that they are present.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then where do you put the three not working rows in your search?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 06:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634192#M14885</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T06:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634194#M14886</link>
      <description>&lt;P&gt;can dedup all in a single line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;subject is there.&lt;/P&gt;&lt;P&gt;mvcount is there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my old command.&lt;/P&gt;&lt;P&gt;| stats values(recipient) as recipient values(subject) as subject earliest(_time) AS "Earliest" latest(_time) AS "Latest" by RecipientDomain sender&lt;BR /&gt;| where mvcount(recipient)=1&lt;BR /&gt;| eval subject_count=mvcount(subject)&lt;BR /&gt;| sort - subject_count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to move this into my new command , which i first posted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 06:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634194#M14886</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T06:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634196#M14887</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your previous rows&amp;gt;
| stats 
   values(recipient) AS recipient 
   dc(recipient) AS recipient_count
   values(subject) AS subject 
   dc(subject) AS subject_count
   earliest(_time) AS "Earliest" 
   latest(_time) AS "Latest" 
   BY RecipientDomain sender
| where recipient_count=1
| sort -subject_count&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 06:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634196#M14887</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T06:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634197#M14888</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=mail&lt;BR /&gt;| dedup Subject&lt;BR /&gt;| lookup email_domain_whitelist domain AS RecipientDomain output domain as domain_match&lt;BR /&gt;| where isnull(domain_match)&lt;BR /&gt;| lookup all_email_provider_domains domain AS RecipientDomain output domain as domain_match2&lt;BR /&gt;| where isnotnull(domain_match2)&lt;BR /&gt;| stats&lt;BR /&gt;values(recipient) AS recipient&lt;BR /&gt;dc(recipient) AS recipient_count&lt;BR /&gt;values(subject) AS subject&lt;BR /&gt;dc(subject) AS subject_count&lt;BR /&gt;earliest(_time) AS "Earliest"&lt;BR /&gt;latest(_time) AS "Latest"&lt;BR /&gt;BY RecipientDomain sender&lt;BR /&gt;| where recipient_count=1&lt;BR /&gt;| sort -subject_count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i cannot see anything under statitics.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 06:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634197#M14888</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T06:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634199#M14889</link>
      <description>&lt;P&gt;in events i can see, i cannot see anything under statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:01:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634199#M14889</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634200#M14890</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;what about if you remove the condition "&lt;SPAN&gt;| where recipient_count=1"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:02:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634200#M14890</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634201#M14891</link>
      <description>&lt;P&gt;it does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=mail&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| dedup MessageTraceId&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| dedup MessageId&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| dedup subject&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| lookup email_domain_whitelist domain AS RecipientDomain output domain as domain_match&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| where isnull(domain_match)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| lookup all_email_provider_domains domain AS RecipientDomain output domain as domain_match2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| where isnotnull(domain_match2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| table RecipientDomain SenderAddress RecipientAddress Subject Received&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this work , without any filter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;stats does not work only table works like this without any filters. Please help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634201#M14891</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634202#M14892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;continue debugging removing the other conditions:&lt;/P&gt;&lt;P&gt;before "&lt;SPAN&gt;| where isnotnull(domain_match2)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then "| where isnull(domain_match)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to identify where is the issue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634202#M14892</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634203#M14893</link>
      <description>&lt;P&gt;&lt;SPAN&gt;| table RecipientDomain SenderAddress RecipientAddress Subject Received&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this work , without any filter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;stats does not work only table works like this without any filters. Please help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i try to deubg it is not showing anything under statitics.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634203#M14893</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634204#M14894</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if table works and stats doesn't work, it should mean that you haven't in any event both the fields used as keys in the stats command ("&lt;SPAN&gt;RecipientDomain" and "sender"), check if you have the 100% of these fields and if there are events where they are both present.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If there aren't you have to find a different aggregation logic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634204#M14894</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634205#M14895</link>
      <description>&lt;P&gt;in events&amp;nbsp;&lt;SPAN class=""&gt;SenderAddress is sender, in raw log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Recipient Domain is under&amp;nbsp;&lt;/SPAN&gt;INTERESTING FIELDS, which is working when using table command.&lt;/P&gt;&lt;P&gt;Please help for the last 3 lines.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634205#M14895</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634207#M14896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes they are, but tey are in the 100% of events?&lt;BR /&gt;probably the problem is that they aren't both present in events, so if you use "stats BY&amp;nbsp;&lt;SPAN&gt;RecipientDomain sender" you haven't results&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you could try to put&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fillnull value="-" RecipientDomain 
| fillnull value="-" sender&lt;/LI-CODE&gt;&lt;P&gt;before the stats command, to be sure to have values in both the fields in each event.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634207#M14896</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634210#M14897</link>
      <description>&lt;P&gt;i have able to make it work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=mail&lt;BR /&gt;| dedup Subject&lt;BR /&gt;| lookup email_domain_whitelist domain AS RecipientDomain output domain as domain_match&lt;BR /&gt;| where isnull(domain_match)&lt;BR /&gt;| lookup all_email_provider_domains domain AS RecipientDomain output domain as domain_match2&lt;BR /&gt;| where isnotnull(domain_match2)&lt;BR /&gt;| stats values(RecipientAddress) as Recipient values(Subject) as Subject latest(_time) as "Time" by RecipientDomain SenderAddress&lt;BR /&gt;| where mvcount(Recipient)=1&lt;BR /&gt;| eval subject_count=mvcount(Subject)&lt;BR /&gt;| sort - subject_count&lt;BR /&gt;| convert ctime("Time")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please check.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634210#M14897</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634212#M14898</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if it runs it's good for you and I'm happy for you!&lt;/P&gt;&lt;P&gt;Please make only one check:&lt;/P&gt;&lt;P&gt;the condition "&lt;SPAN&gt;| where mvcount(Recipient)=1" is always satisfied by definition, but you're sure that in Recipent you have only one value?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634212#M14898</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634214#M14899</link>
      <description>&lt;P&gt;yes i only want to see 1 recipient , if there are 2 recipient i do not want the results to be displayed,&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634214#M14899</guid>
      <dc:creator>sulaimancds</dc:creator>
      <dc:date>2023-03-13T07:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: email filter query</title>
      <link>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634216#M14900</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254197"&gt;@sulaimancds&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I understood your requirement, but my question is: check if in recipient you effectively have one recipient and not two or more in the same field.&lt;/P&gt;&lt;P&gt;If it's true, you solved your issue.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Search-to-filter-email/m-p/634216#M14900</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-13T07:42:51Z</dc:date>
    </item>
  </channel>
</rss>

