<?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 filter a multivalue field so it returns results containing 3 or more values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299595#M90264</link>
    <description>&lt;P&gt;Hello, thanks in advance for the help. I'd like to filter a multivalue field to where it will only return results that contain 3 or more values. This is in regards to email querying.&lt;/P&gt;

&lt;P&gt;I am trying to figure out when somebody's account has been phished, because when they are phished, the attacker keeps sending out gobs of spam to gmail and hotmail addresses.&lt;/P&gt;

&lt;P&gt;My fields are _time, sender, sender_domain, recipient, and message_subject&lt;/P&gt;

&lt;P&gt;The recipient field will have up to 100 recipients. I want it to only show results that have greater than 2 recipients, and the recipients have at least one @Anonymous.com address, or @hotmail.com address. Below is the search I use, but obviously needs work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MSExchange:2013:MessageTracking |dedup sender,recipient,message_subject, message_id |table _time sender sender_domain recipient recipient_domain message_subject |sort -_time |
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:06:35 GMT</pubDate>
    <dc:creator>cm22486</dc:creator>
    <dc:date>2020-09-29T14:06:35Z</dc:date>
    <item>
      <title>How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299595#M90264</link>
      <description>&lt;P&gt;Hello, thanks in advance for the help. I'd like to filter a multivalue field to where it will only return results that contain 3 or more values. This is in regards to email querying.&lt;/P&gt;

&lt;P&gt;I am trying to figure out when somebody's account has been phished, because when they are phished, the attacker keeps sending out gobs of spam to gmail and hotmail addresses.&lt;/P&gt;

&lt;P&gt;My fields are _time, sender, sender_domain, recipient, and message_subject&lt;/P&gt;

&lt;P&gt;The recipient field will have up to 100 recipients. I want it to only show results that have greater than 2 recipients, and the recipients have at least one @Anonymous.com address, or @hotmail.com address. Below is the search I use, but obviously needs work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MSExchange:2013:MessageTracking |dedup sender,recipient,message_subject, message_id |table _time sender sender_domain recipient recipient_domain message_subject |sort -_time |
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299595#M90264</guid>
      <dc:creator>cm22486</dc:creator>
      <dc:date>2020-09-29T14:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299596#M90265</link>
      <description>&lt;P&gt;Try like this (assuming field recipient is mulitivalued field. You may not need the makemv command)&lt;BR /&gt;
&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MSExchange:2013:MessageTracking |dedup sender,recipient,message_subject, message_id |table _time sender sender_domain recipient recipient_domain message_subject | makemv recipient
| where mvcount(recipient)&amp;gt;2 AND (isnotnull(mvfind(recipient,"\.gmail\.com")) OR isnotnull(mvfind(recipient,"\.hotmail\.com")))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 May 2017 18:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299596#M90265</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-17T18:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299597#M90266</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| where mvcount (mvfilter (match (recipient,"\.gmail\.com") OR match (recipient,"\.hotmail\.com") ) )&amp;gt;2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated to add one more close parenthesis.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299597#M90266</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-17T19:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299598#M90267</link>
      <description>&lt;P&gt;Error in 'where' command: The expression is malformed. Expected ).&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299598#M90267</guid>
      <dc:creator>cm22486</dc:creator>
      <dc:date>2017-05-17T19:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299599#M90268</link>
      <description>&lt;P&gt;"Error in 'where' command: The arguments to the 'mvfind' function are invalid."&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299599#M90268</guid>
      <dc:creator>cm22486</dc:creator>
      <dc:date>2017-05-17T19:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299600#M90269</link>
      <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299600#M90269</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-17T19:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299601#M90270</link>
      <description>&lt;P&gt;That did it! Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 19:34:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299601#M90270</guid>
      <dc:creator>cm22486</dc:creator>
      <dc:date>2017-05-17T19:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299602#M90271</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MSExchange:2013:MessageTracking
|dedup sender,recipient,message_subject, message_id
| where mvcount(recipient) &amp;gt;= 3 AND isnotnull(mvfilter(match(recipient, "@(?:gmail|hotmail)\.com$")))
| table _time sender sender_domain recipient recipient_domain message_subject
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 May 2017 20:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299602#M90271</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-17T20:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field so it returns results containing 3 or more values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299603#M90272</link>
      <description>&lt;P&gt;Added one close paren.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 23:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-so-it-returns-results/m-p/299603#M90272</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-17T23:53:52Z</dc:date>
    </item>
  </channel>
</rss>

