<?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: Need help with query and excluding various items in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509553#M142418</link>
    <description>There seems to be a stray "!" in the red text. Is that in the original query or an error in copying into the question?</description>
    <pubDate>Thu, 16 Jul 2020 17:25:32 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-07-16T17:25:32Z</dc:date>
    <item>
      <title>Office 365 Plugin: How to create alerts for attempted logins that also exclude specific user ID's and domains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509547#M142416</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I have the Office 365 plugin, and looking to refine some alerts I have setup. The alert is to notify me of an attempted login from Outside the United States, except a few users with a specific user ID and excluding a specific domain.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything works, with the exception of excluding a specific domain. Here is the search that I have setup (I have removed the sensitive information):&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;`m365_default_index` sourcetype="o365:management:activity" Workload=AzureActiveDirectory Operation=UserLoggedIn&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;| iplocation ClientIP &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;| where Country !="United States" AND NOT UserId="user1@test.com" AND NOT UserId="user2@test.com" AND NOT UserId="user3@test.com" AND NOT UserId="user1@test2.com" AND NOT UserId="user2@test2.com" AND NOT UserId="user3@test2.com" AND NOT UserId="user4@test2.com" AND NOT UserId="user5@test2.com" &lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;AND NOT !UserId="*@test3.com"&lt;/FONT&gt;&lt;BR /&gt;| table _time UserId LogonError ClientIP Country&lt;BR /&gt;| rename app AS App UserId AS User ExtendedProperties{}.Value AS Reason ClientIP AS "Client IP"&lt;BR /&gt;| sort - _time, user&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;The things that work are highlighted in green. &lt;FONT color="#FF0000"&gt;The thing that doesn't work is highlighted in red.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Side note: My goal with the item in red is to exclude the entire domain test3.com for any user. For example, &lt;A href="mailto:user1@test3.com" target="_blank" rel="noopener"&gt;user1@test3.com&lt;/A&gt;&amp;nbsp;is under the "User ID" field, so I am just wanting anything at test3.com to be excluded. That is not working for some reason. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you all!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 19:21:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509547#M142416</guid>
      <dc:creator>ryanbarnes306</dc:creator>
      <dc:date>2020-07-16T19:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509553#M142418</link>
      <description>There seems to be a stray "!" in the red text. Is that in the original query or an error in copying into the question?</description>
      <pubDate>Thu, 16 Jul 2020 17:25:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509553#M142418</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-16T17:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509557#M142421</link>
      <description>&lt;P&gt;That was stray, sorry about that! Query is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`m365_default_index` sourcetype="o365:management:activity" Workload=AzureActiveDirectory Operation=UserLoggedIn&lt;BR /&gt;| iplocation ClientIP&lt;BR /&gt;| where Country !="United States" AND NOT UserId="user1@test.com" AND NOT UserId="user2@test.com" AND NOT UserId="user3@test.com" AND NOT UserId="user1@test2.com" AND NOT UserId="user2@test2.com" AND NOT UserId="user3@test2.com" AND NOT UserId="user4@test2.com" AND NOT UserId="user5@test2.com" AND NOT UserId="*@test3.com"&lt;BR /&gt;| table _time UserId LogonError ClientIP Country&lt;BR /&gt;| rename app AS App UserId AS User ExtendedProperties{}.Value AS Reason ClientIP AS "Client IP"&lt;BR /&gt;| sort - _time, user&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 17:57:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509557#M142421</guid>
      <dc:creator>ryanbarnes306</dc:creator>
      <dc:date>2020-07-16T17:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509560#M142422</link>
      <description>&lt;P&gt;I also tried the following and no dice:&lt;/P&gt;&lt;P&gt;`m365_default_index` sourcetype="o365:management:activity" Workload=AzureActiveDirectory Operation=UserLoggedIn&lt;BR /&gt;| iplocation ClientIP&lt;BR /&gt;| where Country !="United States" AND NOT UserId="user1@test.com" AND NOT UserId="user2@test.com" AND NOT UserId="user3@test.com" AND NOT UserId="user1@test2.com" AND NOT UserId="user2@test2.com" AND NOT UserId="user3@test2.com" AND NOT UserId="user4@test2.com" AND NOT UserId="user5@test2.com" AND !UserId="*@test3.com"&lt;BR /&gt;| table _time UserId LogonError ClientIP Country&lt;BR /&gt;| rename app AS App UserId AS User ExtendedProperties{}.Value AS Reason ClientIP AS "Client IP"&lt;BR /&gt;| sort - _time, user&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 18:02:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509560#M142422</guid>
      <dc:creator>ryanbarnes306</dc:creator>
      <dc:date>2020-07-16T18:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509599#M142436</link>
      <description>&lt;P&gt;Try this search.&amp;nbsp; It breaks out the unwanted domain into a separate command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`m365_default_index` sourcetype="o365:management:activity" Workload=AzureActiveDirectory Operation=UserLoggedIn
| iplocation ClientIP
| where Country !="United States" AND NOT UserId="user1@test.com" AND NOT UserId="user2@test.com" AND NOT UserId="user3@test.com" AND NOT UserId="user1@test2.com" AND NOT UserId="user2@test2.com" AND NOT UserId="user3@test2.com" AND NOT UserId="user4@test2.com" AND NOT UserId="user5@test2.com" 
| where NOT match(UserId, "@test3.com")
| table _time UserId LogonError ClientIP Country
| rename app AS App UserId AS User ExtendedProperties{}.Value AS Reason ClientIP AS "Client IP"
| sort - _time, user&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509599#M142436</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-16T20:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509721#M142472</link>
      <description>&lt;P&gt;Worked like a charm, you rock, thanks! Can I ask one more question? If I wanted to filter on another field (screenshot here), how would I do that? Say I do not want to include the "FaultDomainRedirect" results?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ryanbarnes306_0-1594995759191.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9749iC5D09BB58C38B670/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ryanbarnes306_0-1594995759191.png" alt="ryanbarnes306_0-1594995759191.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 14:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509721#M142472</guid>
      <dc:creator>ryanbarnes306</dc:creator>
      <dc:date>2020-07-17T14:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with query and excluding various items</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509738#M142475</link>
      <description>&lt;P&gt;Include the unwanted field in the where command like so.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`m365_default_index` sourcetype="o365:management:activity" Workload=AzureActiveDirectory Operation=UserLoggedIn
| iplocation ClientIP
| where Country !="United States" AND NOT UserId="user1@test.com" AND NOT UserId="user2@test.com" AND NOT UserId="user3@test.com" AND NOT UserId="user1@test2.com" AND NOT UserId="user2@test2.com" AND NOT UserId="user3@test2.com" AND NOT UserId="user4@test2.com" AND NOT UserId="user5@test2.com" 
| where NOT match(UserId, "@test3.com" OR LogonError="FaultDomainRedirect")
| table _time UserId LogonError ClientIP Country
| rename app AS App UserId AS User ExtendedProperties{}.Value AS Reason ClientIP AS "Client IP"
| sort - _time, user&lt;/LI-CODE&gt;&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 15:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Office-365-Plugin-How-to-create-alerts-for-attempted-logins-that/m-p/509738#M142475</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-17T15:37:21Z</dc:date>
    </item>
  </channel>
</rss>

