<?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: Can you help me optimize this query without join using stats and OR? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403779#M116835</link>
    <description>&lt;P&gt;index="index1"  sourcetype=show_command_output&lt;BR /&gt;
| join Id [ search index="index2" sourcetype=software_data ]&lt;BR /&gt;
| sort _time&lt;BR /&gt;
| stats last(state) as state by name, device_id, interface&lt;BR /&gt;
| where state != "UP"&lt;BR /&gt;
| dedup name, device_id, interface&lt;/P&gt;

&lt;P&gt;index1 has fields Id, device_id, interface&lt;BR /&gt;
index2  has fields name, Id &lt;/P&gt;

&lt;P&gt;Let me know if require more information &lt;/P&gt;

&lt;P&gt;i am facing difficulty here "by name,device_id,interface" because name is field of index2 and device_id and interface are the fields of index1&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:28:56 GMT</pubDate>
    <dc:creator>m4sucess</dc:creator>
    <dc:date>2020-09-29T21:28:56Z</dc:date>
    <item>
      <title>Can you help me optimize this query without join using stats and OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403777#M116833</link>
      <description>&lt;P&gt;index="index1"  sourcetype=show_command&lt;BR /&gt;
| join id [ search index="index2" sourcetype=software_data  ]&lt;BR /&gt;
| sort _time&lt;BR /&gt;
| stats last(state) as state by name, device_id, interface&lt;BR /&gt;
| where state != "UP"&lt;BR /&gt;
| dedup name&lt;BR /&gt;
| stats count&lt;/P&gt;

&lt;P&gt;I want to optimize this query with without join using stats and OR, can anyone help me?&lt;/P&gt;

&lt;P&gt;Here index1 has fields like id,device_id and interface&lt;BR /&gt;
index2 has name,id&lt;/P&gt;

&lt;P&gt;Here index1 has suppose 15 ids, then index2 has 30 ids. Out of which 10 ids are common.&lt;/P&gt;

&lt;P&gt;I am feeling difficulty here because "by name, device_id, interface" in this name is of index2 field and rest are of index1. So, I am feeling difficult.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:28:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403777#M116833</guid>
      <dc:creator>m4sucess</dc:creator>
      <dc:date>2020-09-29T21:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me optimize this query without join using stats and OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403778#M116834</link>
      <description>&lt;P&gt;This is not answerable without some more information about the data in these indexes 1 and 2.   Can you post an event or two example of each (scrubbed is fine)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 17:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403778#M116834</guid>
      <dc:creator>darrenfuller</dc:creator>
      <dc:date>2018-10-01T17:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me optimize this query without join using stats and OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403779#M116835</link>
      <description>&lt;P&gt;index="index1"  sourcetype=show_command_output&lt;BR /&gt;
| join Id [ search index="index2" sourcetype=software_data ]&lt;BR /&gt;
| sort _time&lt;BR /&gt;
| stats last(state) as state by name, device_id, interface&lt;BR /&gt;
| where state != "UP"&lt;BR /&gt;
| dedup name, device_id, interface&lt;/P&gt;

&lt;P&gt;index1 has fields Id, device_id, interface&lt;BR /&gt;
index2  has fields name, Id &lt;/P&gt;

&lt;P&gt;Let me know if require more information &lt;/P&gt;

&lt;P&gt;i am facing difficulty here "by name,device_id,interface" because name is field of index2 and device_id and interface are the fields of index1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403779#M116835</guid>
      <dc:creator>m4sucess</dc:creator>
      <dc:date>2020-09-29T21:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me optimize this query without join using stats and OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403780#M116836</link>
      <description>&lt;P&gt;Hi, I have updated the query and added few information, let me know if you need more info.&lt;/P&gt;

&lt;P&gt;Here index1 has suppose 15 ids, then index2 has 30 ids. Out of which 10 ids are common.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-optimize-this-query-without-join-using-stats-and/m-p/403780#M116836</guid>
      <dc:creator>m4sucess</dc:creator>
      <dc:date>2018-10-02T17:00:04Z</dc:date>
    </item>
  </channel>
</rss>

