<?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: problem with join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/problem-with-join/m-p/682078#M233048</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266331"&gt;@Mahmoud&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Don't use join: Splunk isn't a relational Database, it's a search engine, use stats BY the common key, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="WinEventLog:Sysmon" lsass SourceImage="C:\\Windows\\system32\\rundll32.exe" EventCode IN (10,1)
| eval ProcessId=coalesce(SourceProcessId,ProcessId)
| stats 
   values(TargetImage) AS TargetImage
   values(commandLine) AS commandLine
   BY ProcessId&lt;/LI-CODE&gt;&lt;P&gt;if you want to add an additional condition, e.g. only the ProcessId present in both the EventCodes, you can ann an additional final constrain.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="WinEventLog:Sysmon" lsass SourceImage="C:\\Windows\\system32\\rundll32.exe" EventCode IN (10,1)
| eval ProcessId=coalesce(SourceProcessId,ProcessId)
| stats 
   values(TargetImage) AS TargetImage
   values(commandLine) AS commandLine
   dc(EventCode) AS EventCode_count
   BY ProcessId
| where EventCode_count=2
| fields - EventCode_count&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2024 07:54:52 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-03-27T07:54:52Z</dc:date>
    <item>
      <title>problem with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-join/m-p/682077#M233047</link>
      <description>&lt;P&gt;this is the query, so i'm still a baby in this world (so I'm sorry if there is a dummy mistakes that might drive you crazy when you read this query). However, I'm trying to Join the Source Process Id (from event code 10) with the Process Id ( from event code 1) and then print the command line, I tried to use `type=inner` but it gave me nothing which is wired, because when I look for the first query there is result and the same for the inner query.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="WinEventLog:Sysmon" EventCode=10 lsass SourceImage="C:\\Windows\\system32\\rundll32.exe"
| join left=L right=R type=left where L.SourceProcessId=R.ProcessId
[search EventCode=1 lsass "C:\\Windows\\system32\\rundll32.exe"]
| table L.TargetImage, R.ProcessId, R.commandLine&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 07:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-join/m-p/682077#M233047</guid>
      <dc:creator>Mahmoud</dc:creator>
      <dc:date>2024-03-27T07:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem with join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-join/m-p/682078#M233048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266331"&gt;@Mahmoud&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Don't use join: Splunk isn't a relational Database, it's a search engine, use stats BY the common key, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="WinEventLog:Sysmon" lsass SourceImage="C:\\Windows\\system32\\rundll32.exe" EventCode IN (10,1)
| eval ProcessId=coalesce(SourceProcessId,ProcessId)
| stats 
   values(TargetImage) AS TargetImage
   values(commandLine) AS commandLine
   BY ProcessId&lt;/LI-CODE&gt;&lt;P&gt;if you want to add an additional condition, e.g. only the ProcessId present in both the EventCodes, you can ann an additional final constrain.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="WinEventLog:Sysmon" lsass SourceImage="C:\\Windows\\system32\\rundll32.exe" EventCode IN (10,1)
| eval ProcessId=coalesce(SourceProcessId,ProcessId)
| stats 
   values(TargetImage) AS TargetImage
   values(commandLine) AS commandLine
   dc(EventCode) AS EventCode_count
   BY ProcessId
| where EventCode_count=2
| fields - EventCode_count&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 07:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-join/m-p/682078#M233048</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-27T07:54:52Z</dc:date>
    </item>
  </channel>
</rss>

