<?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 replace join in this below query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533419#M150718</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi Bowesmana,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you also help me in solving the query ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 08:51:36 GMT</pubDate>
    <dc:creator>priyastalin</dc:creator>
    <dc:date>2020-12-17T08:51:36Z</dc:date>
    <item>
      <title>How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533277#M150672</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215385"&gt;@dmarling&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've replaced join in the below query and posted that query as well but I'm not getting proper output correct me if I made any mistake&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query with join:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;"index=168347-np&lt;BR /&gt;[| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*)&lt;BR /&gt;| fields deviceId, deviceName, physicalElementId, hwEoxId&lt;BR /&gt;| join deviceId [ search index=168347-np [| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=290681 | fields deviceId ]&lt;BR /&gt;| fields deviceName, physicalElementId, hwEoxId&lt;BR /&gt;| dedup physicalElementId&lt;BR /&gt;| table deviceName, physicalElementId, hwEoxId&lt;BR /&gt;| stats count as Devices by hwEoxId&lt;BR /&gt;| stats sum(Devices) as Devices "&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Replaced join from the above query:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;"index=168347-np&lt;BR /&gt;([| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*)) OR&lt;BR /&gt;([| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=290681)&lt;BR /&gt;| fields deviceId deviceName physicalElementId hwEoxId sourcetype&lt;BR /&gt;| stats values(sourcetype) as sourcetype values(deviceName) as deviceName values(physicalElementId) as physicalElementId values(hwEoxId) as hwEoxId by deviceId&lt;BR /&gt;| search sourcetype=hw_eox sourcetype=group_members&lt;BR /&gt;| table deviceName, physicalElementId, hwEoxId&lt;BR /&gt;| stats count as Devices by hwEoxId&lt;BR /&gt;| stats sum(Devices) as Devices"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 06:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533277#M150672</guid>
      <dc:creator>priyastalin</dc:creator>
      <dc:date>2020-12-16T06:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533319#M150686</link>
      <description>&lt;P&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215385" target="_blank"&gt;@dmarling&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi, Any update on the above query?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 11:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533319#M150686</guid>
      <dc:creator>priyastalin</dc:creator>
      <dc:date>2020-12-16T11:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533326#M150688</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Without knowing your underlying data it will be hard for me to know what is wrong.&amp;nbsp; The execution of the query is what I would recommend to remove a join.&amp;nbsp; I did notice something odd on the final two lines of your non-join query.&amp;nbsp; You are counting the rows by hwEoxId then summing that count.&amp;nbsp; It's possible you could be double counting rows when doing it by hwEoxId if there are multiple hwEoxId&amp;nbsp; per deviceId.&amp;nbsp; If that is the case you can correct that by doing this query instead:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;index=168347-np 
    ([| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*)) OR
    ([| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=290681)
| fields deviceId deviceName physicalElementId hwEoxId sourcetype
| stats values(deviceName) as deviceName values(physicalElementId) as physicalElementId values(sourcetype) as sourcetype values(hwEoxId) as hwEoxId by deviceId
| search sourcetype=hw_eox sourcetype=group_members hwEoxId=*
| stats count as Devices&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Dec 2020 13:14:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533326#M150688</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2020-12-16T13:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533418#M150717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215385"&gt;@dmarling&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying the below query which you shared it not working exactly.&lt;/P&gt;&lt;P&gt;I would like to give some inputs,&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;This is query with join:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;" index=168347-np &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*) &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fields deviceId, deviceName, physicalElementId, hwEoxId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| join deviceId [ search index=168347-np [| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=309425 | fields deviceId ] &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fields deviceName, physicalElementId, hwEoxId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| dedup physicalElementId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| table deviceName, physicalElementId, hwEoxId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| stats count as Devices by hwEoxId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| stats sum(Devices) as Devices"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sample ouput of the&amp;nbsp; 1stquery " index=168347-np &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| fields deviceId, deviceName, physicalElementId, hwEoxId" &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;cpyKey&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t number"&gt;168347&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;currentEoxMilestone&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;LDoS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;currentEoxMilestoneDate&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;2018-01-31T00:00:00&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;deviceId&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t number"&gt;18468220&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;deviceName&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;10.24.13.240&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;hwEoxId&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t number"&gt;286609&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;nextEoxMilestone&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t null"&gt;null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;nextEoxMilestoneDate&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t null"&gt;null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;physicalElementId&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t number"&gt;362026445&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;physicalType&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;Power Supply&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;productId&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;C3K-PWR-265WAC&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;timeStamp&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t string"&gt;2020-12-15T12:57:03&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;&lt;STRONG&gt;Output of second query"index=168347-np [| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=309425 | fields deviceId"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;&lt;SPAN class="key-name"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;&lt;SPAN class="key-name"&gt;deviceId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;:&lt;SPAN class="t number"&gt;16642716&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="key-name"&gt;groupId&lt;/SPAN&gt;:&lt;SPAN class="t number"&gt;309425&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="key-name"&gt;groupName&lt;/SPAN&gt;:Cisco 3900 ISR Routers&lt;BR /&gt;&lt;SPAN class="key-name"&gt;timeStamp&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;2020-12-15T12:56:41"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output of the query till dedup of&amp;nbsp;physicalElementId&amp;nbsp; "index=168347-np &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| fields deviceId, deviceName, physicalElementId, hwEoxId &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| join deviceId [ search index=168347-np [| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=290681 | fields deviceId ] &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| fields deviceName, physicalElementId, hwEoxId&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| dedup physicalElementId"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;''&lt;/STRONG&gt;&lt;EM&gt; ''&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;cpyKey&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class="t number"&gt;168347&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;currentEoxMilestone&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;LDoS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;currentEoxMilestoneDate&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;2018-03-31T00:00:00&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;deviceId&lt;/SPAN&gt;:&lt;SPAN class="t number"&gt;15459204&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;deviceName&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;10.82.112.71&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;hwEoxId&lt;/SPAN&gt;:&lt;SPAN class="t number"&gt;266079&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;nextEoxMilestone&lt;/SPAN&gt;:&lt;SPAN class="t null"&gt;null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;nextEoxMilestoneDate&lt;/SPAN&gt;:&lt;SPAN class="t null"&gt;null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;physicalElementId&lt;/SPAN&gt;:&lt;SPAN class="t number"&gt;341757347&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;physicalType&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;Module&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;productId&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;SFP-GE-L&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="key-name"&gt;timeStamp&lt;/SPAN&gt;:&lt;SPAN class="t string"&gt;2020-12-15T12:57:02""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;Also I have attached the table values as pdf&amp;nbsp; for ""| table deviceName, physicalElementId, hwEoxId""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;Please help me in removing the join in the query at the top.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t string"&gt;Thanks a lot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 08:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533418#M150717</guid>
      <dc:creator>priyastalin</dc:creator>
      <dc:date>2020-12-17T08:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533419#M150718</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi Bowesmana,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you also help me in solving the query ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 08:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533419#M150718</guid>
      <dc:creator>priyastalin</dc:creator>
      <dc:date>2020-12-17T08:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533480#M150742</link>
      <description>&lt;P&gt;Thank you for the details on the expected output of your data with examples.&amp;nbsp; Without seeing what the output that the query I proposed is doing it's difficult to know what is going on but I am going to assume that this data changes over time due to you using dedup and using values on the stats was causing multiple events to show up on each deviceId row.&amp;nbsp; This can be solved by simply using latest instead of values on those fields:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;index=168347-np 
    ([| `last_np_sourcetype("index=168347-np", "hw_eox")`] currentEoxMilestone=EoSCR OR currentEoxMilestone=LDoS (physicalType=*)) OR
    ([| `last_np_sourcetype( "index=168347-np", "group_members")` ] groupId=290681)
| fields deviceId deviceName physicalElementId hwEoxId sourcetype
| stats latest(deviceName) as deviceName latest(physicalElementId) as physicalElementId values(sourcetype) as sourcetype latest(hwEoxId) as hwEoxId latest(groupName) as groupName latest(groupId) as groupId by deviceId
| search sourcetype=hw_eox sourcetype=group_members
| stats count as Devices&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you ever need more fields you just add them to the stats line using latest so you always get the most current results for the deviceId.&amp;nbsp; Here's a run anywhere example demonstrating this using fake data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| makeresults count=1
| eval data="cpyKey: 168347, currentEoxMilestone: LDoS, currentEoxMilestoneDate: 2018-01-31T00:00:00, deviceId: 18468220, deviceName: 10.24.13.240, hwEoxId: 286609, nextEoxMilestone: null, nextEoxMilestoneDate: null, physicalElementId: 362026445, physicalType: Power Supply, productId: C3K-PWR-265WAC, timeStamp: 2020-12-15T12:57:03
cpyKey: 168347, currentEoxMilestone: LDoS, currentEoxMilestoneDate: 2018-01-31T00:00:00, deviceId: 18468220, deviceName: 10.82.112.71, hwEoxId: 266079, nextEoxMilestone: null, nextEoxMilestoneDate: null, physicalElementId: 341757347, physicalType: Power Supply, productId: C3K-PWR-265WAC, timeStamp: 2020-12-15T13:57:03
deviceId:18468220, groupId:309425, groupName:Cisco 3900 ISR Routers, timeStamp:2020-12-15T12:56:41"
| makemv data tokenizer="(?&amp;lt;data&amp;gt;[^\n]+)"
| mvexpand data
| rex mode=sed field=data "s/, /\n/g"
| rex field=data "timeStamp: ?(?&amp;lt;timeStamp&amp;gt;[^\s]+)"
| eval _time=strptime(timeStamp, "%FT%T"), sourcetype=if(match(data, "cpyKey"), "hw_eox", "group_members")
| fields - timeStamp
| rex field=data "deviceId: ?(?&amp;lt;deviceId&amp;gt;\d+)"
| rex field=data "deviceName: (?&amp;lt;deviceName&amp;gt;[^\n]+)"
| rex field=data "physicalElementId: (?&amp;lt;physicalElementId&amp;gt;[^\n]+)"
| rex field=data "hwEoxId: (?&amp;lt;hwEoxId&amp;gt;[^\n]+)"
| rex field=data "groupId:(?&amp;lt;groupId&amp;gt;[^\n]+)"
| rex field=data "groupName:(?&amp;lt;groupName&amp;gt;[^\n]+)"
| rex field=data "cpyKey: (?&amp;lt;cpyKey&amp;gt;[^\n]+)"
| rex field=data "currentEoxMilestone: (?&amp;lt;currentEoxMilestone&amp;gt;[^\n]+)"
| rex field=data "currentEoxMilestoneDate: (?&amp;lt;currentEoxMilestoneDate&amp;gt;[^\n]+)"
| rex field=data "nextEoxMilestone: (?&amp;lt;nextEoxMilestone&amp;gt;[^\n]+)"
| rex field=data "nextEoxMilestoneDate: (?&amp;lt;nextEoxMilestoneDate&amp;gt;[^\n]+)"
| rex field=data "physicalType: (?&amp;lt;physicalType&amp;gt;[^\n]+)"
| rex field=data "productId: (?&amp;lt;productId&amp;gt;[^\n]+)"
| stats latest(deviceName) as deviceName latest(physicalElementId) as physicalElementId values(sourcetype) as sourcetype latest(hwEoxId) as hwEoxId latest(groupName) as groupName latest(groupId) as groupId latest(cpyKey) as cpyKey latest(currentEoxMilestone) as currentEoxMilestone latest(currentEoxMilestoneDate) as currentEoxMilestoneDate latest(nextEoxMilestone) as nextEoxMilestone latest(nextEoxMilestoneDate) as nextEoxMilestoneDate latest(physicalType) as physicalType latest(productId) as productId by deviceId
| search sourcetype=hw_eox sourcetype=group_members
| fields - sourcetype deviceId&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll see in the above run anywhere example only the most current values are showing for each field except the sourcetypes because we want to ensure both sourcetypes are being represented in this data.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 15:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533480#M150742</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2020-12-18T15:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533566#M150776</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215385"&gt;@dmarling&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;There is another query with the join. I tried replacing with "OR" but I'm not getting exact output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"index=167515-np sourcetype=hardware &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fields deviceId, productType, productId, physicalType &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| search physicalType=Chassis &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| dedup deviceId &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| join deviceId [ search index=167515-np [| `last_np_sourcetype( "index=167515-np", "group_members")` ] groupId=288348 | fields deviceId ] &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| stats dc(productId) as PIDs by productType &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| search productType=Routers &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| table PIDs"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Could you please help me in solving this??&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 13:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533566#M150776</guid>
      <dc:creator>priyastalin</dc:creator>
      <dc:date>2020-12-18T13:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace join in this below query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533577#M150782</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229747"&gt;@priyastalin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I am not going to be able to go through every possible use case you run into.&amp;nbsp; I will provide you with a concept that should carry through on any use case with the data you've been working with. In general you want to wrap your different base search criteria with parenthesis and with OR between the groups of parenthesis's.&amp;nbsp; You need to identify the correlating field, which in all of of your use cases thus far have been deviceId.&amp;nbsp; You then need to create a stats that will pass through all of the fields you require using "latest(fieldname) as fieldname" and that passes in the values of the sourcetypes with "values(sourcetype) as sourcetype" to ensure you are getting data from both data sets.&amp;nbsp; You then add a search line after the states that ensures you are getting both sourcetypes.&amp;nbsp; Now you can do anything you would like to the resulting data as you normally would have with your join.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Walking through these concepts with your latest example would be making your first line the two different data sets wrapped in parenthesis separated by OR:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;index=167515-np (sourcetype=hardware physicalType=Chassis) OR (sourcetype=group_members groupId=288348)&lt;/LI-CODE&gt;&lt;P&gt;You then define the fields that will be passed through:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| fields deviceId productType productId physicalType sourcetype&lt;/LI-CODE&gt;&lt;P&gt;You then create a stats that provides the latest values for all fields of interest by the key field used for joining&amp;nbsp;, which is deviceId, and that provides all values of the field that will let us know what source it's from, which is sourcetype:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| stats latest(productType) as productType latest(productId) as productId latest(physicalType) as physicalType values(sourcetype) as sourcetype by deviceId&lt;/LI-CODE&gt;&lt;P&gt;Then you add a filter that ensures only data that appears in all of the selected data sources , which in this use case is using sourcetype, are being returned:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| search sourcetype=hardware sourcetype=group_members&lt;/LI-CODE&gt;&lt;P&gt;You now have the fields you need from the two data sets and only data that exists in both data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 14:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-join-in-this-below-query/m-p/533577#M150782</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2020-12-18T14:50:55Z</dc:date>
    </item>
  </channel>
</rss>

