<?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 do I exclude service accounts that match the computer name in search results? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360167#M65680</link>
    <description>&lt;P&gt;I have not been successful in building a search query that excludes results of a service account that matches the computer name.  As an example, we have Server_ABC and it has an account called Server_ABC$.  I only want to display results for User Names(Service accounts) that do not match the local computer name.  If the service account Server_ABC$ tries to log into Server_ZYX, Server_DEF, and Server_ABC, I just want to see the entries for Server_ZYX and Server_DEF.&lt;/P&gt;

&lt;P&gt;I have read the posts below, but they do not provide the results I am looking for.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html" target="_blank"&gt;https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html" target="_blank"&gt;https://answers.splunk.com/answers/93488/how-to-use-lookup-to-exclude-a-list-of-user-names-and-service-file-names.html&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:23:41 GMT</pubDate>
    <dc:creator>RedHonda03</dc:creator>
    <dc:date>2020-09-29T17:23:41Z</dc:date>
    <item>
      <title>How do I exclude service accounts that match the computer name in search results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360167#M65680</link>
      <description>&lt;P&gt;I have not been successful in building a search query that excludes results of a service account that matches the computer name.  As an example, we have Server_ABC and it has an account called Server_ABC$.  I only want to display results for User Names(Service accounts) that do not match the local computer name.  If the service account Server_ABC$ tries to log into Server_ZYX, Server_DEF, and Server_ABC, I just want to see the entries for Server_ZYX and Server_DEF.&lt;/P&gt;

&lt;P&gt;I have read the posts below, but they do not provide the results I am looking for.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html" target="_blank"&gt;https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/387055/how-to-exclude-computer-account-name-from-results.html" target="_blank"&gt;https://answers.splunk.com/answers/93488/how-to-use-lookup-to-exclude-a-list-of-user-names-and-service-file-names.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360167#M65680</guid>
      <dc:creator>RedHonda03</dc:creator>
      <dc:date>2020-09-29T17:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I exclude service accounts that match the computer name in search results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360168#M65681</link>
      <description>&lt;P&gt;Please share your search query&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 16:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360168#M65681</guid>
      <dc:creator>naidusadanala</dc:creator>
      <dc:date>2018-01-02T16:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I exclude service accounts that match the computer name in search results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360169#M65682</link>
      <description>&lt;P&gt;This run anywhere example shows one possibility:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval host="Server_ABC", user="Server_ABC$" 
| rex field=user "(?&amp;lt;userminusdollar&amp;gt;.*)\$$" 
| where host!=userminusdollar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The key to the above search is that the &lt;CODE&gt;where&lt;/CODE&gt; command can compare two fields, whereas the &lt;CODE&gt;search&lt;/CODE&gt; command can not.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 18:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360169#M65682</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-02T18:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I exclude service accounts that match the computer name in search results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360170#M65683</link>
      <description>&lt;P&gt;Splunk error: Error in 'makeresults' command: This command must be the first command of a search. &lt;/P&gt;

&lt;P&gt;Below is what I tried.&lt;/P&gt;

&lt;P&gt;sourcetype="windowseventlog:security"&lt;BR /&gt;
| makeresults &lt;BR /&gt;
| eval host="Server_ABC", user="Server_ABC$" &lt;BR /&gt;
| rex field=user "(?.*)\$$" &lt;BR /&gt;
| where host!=userminusdollar&lt;/P&gt;

&lt;P&gt;When I remove the first line which contains the source, I get "No results found."  I'm not sure why I need to have "makeresults" be the first command of a search, when you need to have a source for the data to be searched first.&lt;/P&gt;

&lt;P&gt;makeresults &lt;BR /&gt;
| eval host="Server_ABC", user="Server_ABC$" &lt;BR /&gt;
| rex field=user "(?.*)\$$" &lt;BR /&gt;
| where host!=userminusdollar&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:23:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360170#M65683</guid>
      <dc:creator>RedHonda03</dc:creator>
      <dc:date>2020-09-29T17:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I exclude service accounts that match the computer name in search results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360171#M65684</link>
      <description>&lt;P&gt;My search was intended to be run by itself, not as part of another search.  To try it with your data instead try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=windowseventlog:security
| rex field=user "(?&amp;lt;userminusdollar&amp;gt;.*)\$$" 
| where host!=userminusdollar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above assumes that the username is in a field called &lt;CODE&gt;user&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 20:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-exclude-service-accounts-that-match-the-computer-name/m-p/360171#M65684</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-02T20:05:34Z</dc:date>
    </item>
  </channel>
</rss>

