<?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: How to only keep the rows related with process in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461324#M130118</link>
    <description>&lt;P&gt;Have you tried my second query?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 13:07:10 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-25T13:07:10Z</dc:date>
    <item>
      <title>How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461315#M130109</link>
      <description>&lt;P&gt;Hello, in the below data I have a lot of processes and the ParentProcesses of them. &lt;BR /&gt;
I would like to keep only the rows related with process "Process4" meaning the first 3 rows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
  | eval mydata="Process1,Process2 Process2,Process3 Process3,Process4 Process5,Process6 Process6,Process7 Process8,Process9 Process7,Process10"
  | makemv mydata 
  | mvexpand mydata 
  | makemv delim="," mydata 
  | eval ParentProcess=mvindex(mydata,0) 
  | eval Process=mvindex(mydata,1)
  | table ParentProcess Process
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 16:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461315#M130109</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-02-04T16:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461316#M130110</link>
      <description>&lt;P&gt;So, you want to keep the rows with Process4, and any rows connected to any process that is connected to that one, recursively?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 19:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461316#M130110</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-02-04T19:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461317#M130111</link>
      <description>&lt;P&gt;Yes exactly this one.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 08:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461317#M130111</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-02-05T08:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461318#M130112</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="User,host,parent_process_id,parent_process,process_id,process,count
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",10136,whoami,1
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",10540,\"AdobeExpiryCheck.exe\",1
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",6764,hostname,1
NT AUTHORITY\SYSTEM,Laptop,8100,C:\WINDOWS\PSEXESVC.EXE,11808,\"cmd\",1
NT AUTHORITY\SYSTEM,Laptop,816,C:\WINDOWS\system32\services.exe,8100,C:\WINDOWS\PSEXESVC.EXE,1"
| multikv forceheader=1
| table User,host,parent_process_id,parent_process,process_id,process,count
| sort parent_process_id
| eval parent=parent_process_id."_".parent_process, child=process_id."_".process
| eval processes=mvappend(parent,child)
| stats list(processes) as processes
| nomv processes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;there is many child process, I dare keep this.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461318#M130112</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-25T13:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461319#M130113</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mydata="Process1,Process2 Process2,Process3 Process3,Process4 Process5,Process6 Process6,Process7 Process8,Process9 Process7,Process10" 
| makemv mydata 
| mvexpand mydata 
| makemv delim="," mydata 
| eval ParentProcess=mvindex(mydata,0) 
| eval Process=mvindex(mydata,1) 
| table ParentProcess Process
`comment("this is your sample")`
| sort - ParentProcess Process
| streamstats count(eval(match(ParentProcess,"Process4") OR match(Process,"Process4"))) as session
| where session &amp;gt; 0
| fields - session
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works because the field name is this.&lt;BR /&gt;
It will not be useful if it is an actual log.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mydata="Process1,Process2 Process2,Process3 Process3,Process4 Process5,Process6 Process6,Process7 Process8,Process9 Process7,Process10"
| makemv mydata 
| mvexpand mydata 
| makemv delim="," mydata 
| eval ParentProcess=mvindex(mydata,0) 
| eval Process=mvindex(mydata,1)
| table ParentProcess Process
| where match(ParentProcess, "Process4") OR match(Process, "Process4") 
| head 3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461319#M130113</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-25T13:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461320#M130114</link>
      <description>&lt;P&gt;Basically I would like some how to check the Process4 and then to check backwards Process3-Process2-Process1.&lt;/P&gt;

&lt;P&gt;Basically I would like to find the full tree of the processes when I am selecting the Process4 .&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461320#M130114</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-02-25T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461321#M130115</link>
      <description>&lt;P&gt;Basically I need to find a way when I receive such logs to be able to track the full chain of the process.&lt;/P&gt;

&lt;P&gt;User    host    parent_process_id   parent_process  process_id  process count&lt;BR /&gt;
NT AUTHORITY\SYSTEM Laptop  11808   "cmd"   10136   whoami  1&lt;BR /&gt;
NT AUTHORITY\SYSTEM Laptop  11808   "cmd"   10540   "AdobeExpiryCheck.exe"  1&lt;BR /&gt;
NT AUTHORITY\SYSTEM Laptop  11808   "cmd"   6764    hostname    1&lt;BR /&gt;
NT AUTHORITY\SYSTEM Laptop  8100    C:\WINDOWS\PSEXESVC.EXE 11808   "cmd"   1&lt;BR /&gt;
NT AUTHORITY\SYSTEM Laptop  816 C:\WINDOWS\system32\services.exe    8100    C:\WINDOWS\PSEXESVC.EXE 1&lt;/P&gt;

&lt;P&gt;In this example I would like to find the below.&lt;/P&gt;

&lt;P&gt;C:\WINDOWS\system32\services.exe-&amp;gt;C:\WINDOWS\PSEXESVC.EXE-&amp;gt;"cmd"-&amp;gt;whoami    &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:20:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461321#M130115</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-09-30T04:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461322#M130116</link>
      <description>&lt;P&gt;which is ParentProcess?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461322#M130116</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-25T13:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461323#M130117</link>
      <description>&lt;P&gt;The Process 1 is the parent process of  Process 2&lt;BR /&gt;
The Process 2 is the parent process of  Process 3&lt;BR /&gt;
The Process 3 is the parent process of  Process 4&lt;/P&gt;

&lt;P&gt;So in the above example I would like to find away to get the full chain from process 4 to process 1.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461323#M130117</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-02-25T13:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461324#M130118</link>
      <description>&lt;P&gt;Have you tried my second query?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461324#M130118</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-25T13:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461325#M130119</link>
      <description>&lt;P&gt;The approach is very good. However, from all these processes I am interested only in the ones that end with the whoami. So I would like to find a way to end up with as below:&lt;/P&gt;

&lt;P&gt;C:\WINDOWS\system32\services.exe - &amp;gt;C:\WINDOWS\PSEXESVC.EXE -&amp;gt;\"cmd\" -&amp;gt; whoami excluding the rest.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461325#M130119</guid>
      <dc:creator>vpaschalidis</dc:creator>
      <dc:date>2020-02-25T13:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to only keep the rows related with process</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461326#M130120</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="User,host,parent_process_id,parent_process,process_id,process,count
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",10136,whoami,1
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",10540,\"AdobeExpiryCheck.exe\",1
NT AUTHORITY\SYSTEM,Laptop,11808,\"cmd\",6764,hostname,1
NT AUTHORITY\SYSTEM,Laptop,8100,C:\WINDOWS\PSEXESVC.EXE,11808,\"cmd\",1
NT AUTHORITY\SYSTEM,Laptop,816,C:\WINDOWS\system32\services.exe,8100,C:\WINDOWS\PSEXESVC.EXE,1" 
| multikv forceheader=1 
| table User,host,parent_process_id,parent_process,process_id,process,count 
| sort parent_process_id 
| eval processes=mvappend(parent_process,process) 
| dedup parent_process
| stats list(processes) as processes 
| eval processes=mvdedup(processes)
| eval processes=mvjoin(processes," -&amp;gt; ")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 20:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-keep-the-rows-related-with-process/m-p/461326#M130120</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-25T20:01:54Z</dc:date>
    </item>
  </channel>
</rss>

