<?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: Regex for matching service path in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153214#M43001</link>
    <description>&lt;P&gt;I've edited my regex. That should work. &lt;/P&gt;</description>
    <pubDate>Wed, 18 Feb 2015 18:18:14 GMT</pubDate>
    <dc:creator>sk314</dc:creator>
    <dc:date>2015-02-18T18:18:14Z</dc:date>
    <item>
      <title>Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153208#M42995</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I want to exclude all the WinEventLogs for service C:\Windows\System32\svchost.exe which doesnt contain the default path. So for example I don't want to see all the svchost.exe services which are in this path C:\Windows\System32\&lt;BR /&gt;
If the svchost.exe service is in any different path (e.g. C:\Windows\svchost.exe) I want to get alert on it.&lt;/P&gt;

&lt;P&gt;Any ideas how to do it in most efficient way?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
K.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 10:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153208#M42995</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2015-02-17T10:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153209#M42996</link>
      <description>&lt;P&gt;Additionally there is only one field which includes process name within raw logs - "Process Name: C:\Windows\System32\svchost.exe"&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 10:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153209#M42996</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2015-02-17T10:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153210#M42997</link>
      <description>&lt;P&gt;Could you post a couple of sample events? You could try extracting the process name into a field and then searching for &lt;CODE&gt;field_name  != "c:\Windows\system32\svchost.exe"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Typically your search would be similar to ..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your sourcetype&amp;gt; | rex _raw "Process Name: (?&amp;lt;process_name&amp;gt;[^ ]+)" | search &amp;lt;your sourcetype&amp;gt; process_name !="c:\Windows\system32\svchost.exe" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you can post sample events, I can confirm the regular expression.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 20:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153210#M42997</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-02-17T20:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153211#M42998</link>
      <description>&lt;P&gt;Hello, thanks for this. As for sample events so they are pretty much the same in the raw logs I have the fields ProcessName indexed and extracted which is usually the path and the process I am looking for ProcessName= "c:\Windows\system32\svchost.exe". I imagine how I could end up if I had two separate fields for the path and another for the process itself, but at the moment I am struggling while having everything just in one field. The field in the raw logs is always the same as above example. What I am trying to accomplish is to set up some rules to monitor default processes which start in non-default Windows locations.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 08:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153211#M42998</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2015-02-18T08:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153212#M42999</link>
      <description>&lt;P&gt;Here is a sample log:&lt;BR /&gt;
Access_Mask = 0x2&lt;BR /&gt;
Access_Reasons = -&lt;BR /&gt;
Accesses = Unknown specific access (bit 1)&lt;BR /&gt;
Account_Domain =&lt;BR /&gt;
Account_Name =&lt;BR /&gt;
ComputerName =&lt;BR /&gt;
EventCode = 4656&lt;BR /&gt;
EventCodeDescription = A handle to an object was requested&lt;BR /&gt;
EventType = 0&lt;BR /&gt;
Handle_ID = 0x0&lt;BR /&gt;
Keywords = Audit Success&lt;BR /&gt;
LogName = Security&lt;BR /&gt;
Logon_ID = 0x3e7&lt;BR /&gt;
Message = A handle to an object was requested. &lt;BR /&gt;
&lt;STRONG&gt;Process Name: C:\Windows\System32\svchost.exe&lt;/STRONG&gt; Access Request Information: Transaction ID: {00000000-0000-0000-0000-000000000000} Accesses: Unknown specific access (bit 1) Access Reasons: - Access Mask: 0x2 Privileges Used for Access Check: - Restricted SID Count: 0&lt;BR /&gt;
Object_Name = PlugPlaySecurityObject&lt;BR /&gt;
Object_Server = PlugPlayManager&lt;BR /&gt;
Object_Type = Security&lt;BR /&gt;
OpCode = Info&lt;BR /&gt;
Privileges_Used_for_Access_Check = -&lt;BR /&gt;
Process_ID = 0x244&lt;BR /&gt;
Process_Name = C:\Windows\System32\svchost.exe&lt;BR /&gt;
RecordNumber = 78829788&lt;BR /&gt;
Restricted_SID_Count = 0&lt;BR /&gt;
Security_ID = NT AUTHORITY\SYSTEM&lt;BR /&gt;
SourceName = Microsoft Windows security auditing.&lt;BR /&gt;
TaskCategory = Other Object Access Events&lt;BR /&gt;
Transaction_ID = {00000000-0000-0000-0000-000000000000}&lt;BR /&gt;
Type = Information&lt;BR /&gt;
action = failure&lt;BR /&gt;
action_name = login_fail&lt;BR /&gt;
action_title = Failed Login&lt;BR /&gt;
dest = AZA2MGTXXSQM001&lt;BR /&gt;
eventtype = wst_authentication authentication&lt;BR /&gt;
host =&lt;BR /&gt;
index = gis_wst&lt;BR /&gt;
linecount = 37&lt;BR /&gt;
punct = //&lt;EM&gt;::&lt;/EM&gt;\r=\r=&lt;STRONG&gt;&lt;EM&gt;.\r=\r=\r=\r=..\r=&lt;/EM&gt;&lt;/STRONG&gt;\r=\r=\r=&lt;EM&gt;\r=&lt;/EM&gt;_____.\r\r\r\r:&lt;BR /&gt;
source = WinEventLog:Security&lt;BR /&gt;
sourcetype = WinEventLog:Security&lt;BR /&gt;
splunk_server = tag = authentication&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153212#M42999</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2020-09-28T19:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153213#M43000</link>
      <description>&lt;P&gt;I'm not 100% sure if my answer is what you're looking for, but please see below, if not, leave a comment and i'll get back to you&lt;/P&gt;

&lt;P&gt;if you're trying to send an alert if a field matches what you expect&lt;BR /&gt;
then use a simple if statement, eval SendAlert=if(eval(match(fieldname, "{Either regex or string}")),1,0)&lt;/P&gt;

&lt;P&gt;Then your alert settings should be to send an alert if any event has a field SendAlert set to 1.&lt;/P&gt;

&lt;P&gt;Don't forget to comment if this isn't what you're looking for&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 10:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153213#M43000</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-18T10:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153214#M43001</link>
      <description>&lt;P&gt;I've edited my regex. That should work. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 18:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153214#M43001</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-02-18T18:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153215#M43002</link>
      <description>&lt;P&gt;Thanks, &lt;/P&gt;

&lt;P&gt;havent used extraction in the search ever, so this is what is my search query:&lt;BR /&gt;
sourcetype="WinEventLog:Security" | rex _raw "Process Name: (?[^ ]+)" | search sourcetype="WinEventLog:Security" process_name !="c:\Windows\system32\svchost.exe"&lt;/P&gt;

&lt;P&gt;and this is what i get:&lt;/P&gt;

&lt;P&gt;Error in 'rex' command: The regex '_raw' does not extract anything. It should specify at least one named group. Format: (?...).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153215#M43002</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2020-09-28T19:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153216#M43003</link>
      <description>&lt;P&gt;sorry the query is this:&lt;/P&gt;

&lt;P&gt;sourcetype="WinEventLog:Security" | rex _raw "Process Name: (?[^ ]+)" | search sourcetype="WinEventLog:Security" process_name !="c:\Windows\system32\svchost.exe"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153216#M43003</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2020-09-28T19:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153217#M43004</link>
      <description>&lt;P&gt;Try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="WinEventLog:Security" | rex field=_raw "Process Name: (?&amp;lt;process_name&amp;gt;[^ ]+)" | search sourcetype="WinEventLog:Security" process_name !="c:\Windows\system32\svchost.exe"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Feb 2015 23:49:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153217#M43004</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-02-20T23:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for matching service path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153218#M43005</link>
      <description>&lt;P&gt;Here it is what's worked for me:&lt;/P&gt;

&lt;P&gt;| rex field=unparsed_message   "(?P[A-Za-z]:\[^|]+)" | rex field=fullpath "(?P.&lt;EM&gt;)\\.&lt;/EM&gt;" | rex field=fullpath "(?P\w+.\w+)" &lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 08:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-matching-service-path/m-p/153218#M43005</guid>
      <dc:creator>kestasm</dc:creator>
      <dc:date>2015-03-24T08:58:29Z</dc:date>
    </item>
  </channel>
</rss>

