<?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: Two condition match - sequential number pid and certain values on associated fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578955#M201779</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;This is what I was exactly looking for, well done.&lt;/P&gt;&lt;P&gt;appreciate your help!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 17:43:47 GMT</pubDate>
    <dc:creator>splunkxorsplunk</dc:creator>
    <dc:date>2021-12-20T17:43:47Z</dc:date>
    <item>
      <title>Two condition match - sequential number pid and certain values on associated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578844#M201729</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Need help to get following results from the search.&amp;nbsp; all helps will be appreciated.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On the image below, same colors show match cases I would like to get out of my search. Here is the condition I am looking for:&lt;BR /&gt;&lt;BR /&gt;Under the same pid which is all same already on image below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;example -1 ( green on the image) :&lt;/EM&gt;&lt;BR /&gt;pid_of_curl = 990820&lt;/P&gt;&lt;P&gt;pid_of_sh = 990821&lt;/P&gt;&lt;P&gt;If exe = curl and ( pid_of_curl + 1 ) has exe = sh&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;exe is curl and&amp;nbsp;&amp;nbsp;990820 + 1 =&amp;nbsp;990821 = pid in which exe = sh&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunkxorsplunk_1-1639899002821.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17296i6B9EDAA0EB0B5A73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="splunkxorsplunk_1-1639899002821.png" alt="splunkxorsplunk_1-1639899002821.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;if exe is either "curl" or "wget" and its pid +1 is equal to ( bash or sh ) pid&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 07:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578844#M201729</guid>
      <dc:creator>splunkxorsplunk</dc:creator>
      <dc:date>2021-12-19T07:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Two condition match - sequential number pid and certain values on associated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578845#M201730</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="ppid,pid,exe
981804,991701,ls
981804,991819,rm
981804,990820,curl
981804,990821,sh
981804,991019,ls
981804,991886,bash
981804,991885,curl
981804,990940,bash
981804,991940,curl
981804,990770,ls
981804,990997,sleep
981804,990939,curl
981804,991841,ls
981804,991941,sh"
| multikv forceheader=1
| table _time ppid pid exe



| eval exe_of_interest=if(match(exe,"curl|wget|bash|sh"),pid,null())
| sort 0 ppid pid
| streamstats range(exe_of_interest) as difference window=2 by ppid
| where difference = 1 and match(exe,"bash|sh")&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 19 Dec 2021 11:10:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578845#M201730</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-12-19T11:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Two condition match - sequential number pid and certain values on associated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578868#M201742</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you so much for spending time and providing this solution.&amp;nbsp;&lt;BR /&gt;It gives me the following output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunkxorsplunk_0-1639983617385.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17299iDA3982CFD7D8DB06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="splunkxorsplunk_0-1639983617385.png" alt="splunkxorsplunk_0-1639983617385.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, I need following matches out of the data set.&amp;nbsp;&lt;BR /&gt;logic here is :&lt;BR /&gt;1. under the same ppid, (curl OR wget ) and ( bash OR sh ) should be available&lt;BR /&gt;2. If #1(above) is true, ((pid _of_curl + 1) OR (pid_of_wget + 1 )) = ( pid_of_sh OR pid_of_bash)&lt;BR /&gt;&lt;BR /&gt;time - ppid - pid - exe&lt;BR /&gt;1. time2 -&amp;nbsp;&lt;SPAN&gt;981804&lt;/SPAN&gt;&amp;nbsp;-&amp;nbsp;991885,&amp;nbsp;991885 - curl, bash&lt;/P&gt;&lt;P&gt;2. time2 -&lt;SPAN&gt;981804 -&amp;nbsp;991940,&amp;nbsp;991940 - curl, sh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 07:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578868#M201742</guid>
      <dc:creator>splunkxorsplunk</dc:creator>
      <dc:date>2021-12-20T07:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Two condition match - sequential number pid and certain values on associated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578952#M201776</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="ppid,pid,exe
981804,991701,ls
981804,991819,rm
981804,990820,curl
981804,990821,sh
981804,991019,ls
981804,991886,bash
981804,991885,curl
981804,990940,bash
981804,991940,curl
981804,990770,ls
981804,990997,sleep
981804,990939,curl
981804,991841,ls
981804,991941,sh"
| multikv forceheader=1
| table _time ppid pid exe


| where match(exe,"curl|wget|bash|sh")
| sort 0 ppid pid
| eval curl_wget_time=if(match(exe,"curl|wget"),_time,null())
| eval bash_sh_time=if(match(exe,"bash|sh"),_time,null())
| eval curl_wget_exe=if(match(exe,"curl|wget"),exe,null())
| eval bash_sh_exe=if(match(exe,"bash|sh"),exe,null())
| eval curl_wget_pid=if(match(exe,"curl|wget"),pid,null())
| eval bash_sh_pid=if(match(exe,"bash|sh"),pid,pid+1)
| stats values(curl_wget_pid) as curl_wget_pid values(curl_wget_time) as curl_wget_time values(bash_sh_time) as bash_sh_time values(curl_wget_exe) as curl_wget_exe values(bash_sh_exe) as bash_sh_exe by ppid bash_sh_pid
| fieldformat curl_wget_time=strftime(curl_wget_time,"%F %T")
| fieldformat bash_sh_time=strftime(bash_sh_time,"%F %T")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578952#M201776</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-12-20T17:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Two condition match - sequential number pid and certain values on associated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578955#M201779</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;This is what I was exactly looking for, well done.&lt;/P&gt;&lt;P&gt;appreciate your help!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-condition-match-sequential-number-pid-and-certain-values-on/m-p/578955#M201779</guid>
      <dc:creator>splunkxorsplunk</dc:creator>
      <dc:date>2021-12-20T17:43:47Z</dc:date>
    </item>
  </channel>
</rss>

