<?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 Join 3 Queries into one for usage in Dashboard in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123901#M33471</link>
    <description>&lt;P&gt;I am getting the feeds from Database into Splunk every 15 minutes;  using 3 Queries to get the desired results; can you please help me to combine all these three into a single query&lt;BR /&gt;
Step 1: Find all the &lt;STRONG&gt;Unique IDS&lt;/STRONG&gt; (PAY_TXN_ID) &lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | dedup PAY_TXN_ID | table PAY_TXN_ID&lt;BR /&gt;
Step2: For &lt;STRONG&gt;each of the Unique IDS&lt;/STRONG&gt; obtained from previous query; get the &lt;STRONG&gt;latest Time stamp&lt;/STRONG&gt; (AUDIT_TIME)&lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | search PAY_TXN_ID="3225958" | table AUDIT_TIME | sort -AUDIT_TIME | head 1&lt;BR /&gt;
Step3: For &lt;STRONG&gt;each of the Unique IDS PAY_TXN_ID (step1)&lt;/STRONG&gt;and the &lt;STRONG&gt;latest Time Stamp for that ID(step 2)&lt;/STRONG&gt; get all the &lt;STRONG&gt;required details&lt;/STRONG&gt; - Desired Results&lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | search PAY_TXN_ID="3225958" | search AUDIT_TIME="1345618062.375" | table PAY_TXN_ID, SOURCE, STATUS, DEBIT_CCY, DEBIT_AMNT, REMIT_CCY, REMIT_AMNT&lt;/P&gt;

&lt;P&gt;Can someone help me to convert these three queries into a single one. &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:48:46 GMT</pubDate>
    <dc:creator>kishorksudha</dc:creator>
    <dc:date>2020-09-28T18:48:46Z</dc:date>
    <item>
      <title>Join 3 Queries into one for usage in Dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123901#M33471</link>
      <description>&lt;P&gt;I am getting the feeds from Database into Splunk every 15 minutes;  using 3 Queries to get the desired results; can you please help me to combine all these three into a single query&lt;BR /&gt;
Step 1: Find all the &lt;STRONG&gt;Unique IDS&lt;/STRONG&gt; (PAY_TXN_ID) &lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | dedup PAY_TXN_ID | table PAY_TXN_ID&lt;BR /&gt;
Step2: For &lt;STRONG&gt;each of the Unique IDS&lt;/STRONG&gt; obtained from previous query; get the &lt;STRONG&gt;latest Time stamp&lt;/STRONG&gt; (AUDIT_TIME)&lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | search PAY_TXN_ID="3225958" | table AUDIT_TIME | sort -AUDIT_TIME | head 1&lt;BR /&gt;
Step3: For &lt;STRONG&gt;each of the Unique IDS PAY_TXN_ID (step1)&lt;/STRONG&gt;and the &lt;STRONG&gt;latest Time Stamp for that ID(step 2)&lt;/STRONG&gt; get all the &lt;STRONG&gt;required details&lt;/STRONG&gt; - Desired Results&lt;BR /&gt;
index=foo source="dbmon-tail://Dev/test-DEV" | search PAY_TXN_ID="3225958" | search AUDIT_TIME="1345618062.375" | table PAY_TXN_ID, SOURCE, STATUS, DEBIT_CCY, DEBIT_AMNT, REMIT_CCY, REMIT_AMNT&lt;/P&gt;

&lt;P&gt;Can someone help me to convert these three queries into a single one. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123901#M33471</guid>
      <dc:creator>kishorksudha</dc:creator>
      <dc:date>2020-09-28T18:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Join 3 Queries into one for usage in Dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123902#M33472</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo source="dbmon-tail://Dev/test-DEV" | eventstats max(AUDIT_TIME) as max_audit_time by PAY_TXN_ID | where AUDIT_TIME = max_audit_time | table PAY_TXN_ID, SOURCE, STATUS, DEBIT_CCY, DEBIT_AMNT, REMIT_CCY, REMIT_AMNT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;NB: I have assumed that &lt;CODE&gt;AUDIT_TIME&lt;/CODE&gt; values are unique per &lt;CODE&gt;PAY_TXN_ID&lt;/CODE&gt;. If that's not the case you will get all events with the latest &lt;CODE&gt;AUDIT_TIME&lt;/CODE&gt; for one &lt;CODE&gt;PAY_TXN_ID&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2015 22:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123902#M33472</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-01-31T22:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Join 3 Queries into one for usage in Dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123903#M33473</link>
      <description>&lt;P&gt;Thank you very much Martin; it was very helpful.&lt;BR /&gt;
your assumption was right; AUDIT_TIME values are unique per PAY_TXN_ID.&lt;BR /&gt;
AUDIT_TIME is the rising_column when the datas are being pulled from the Database. &lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kishor&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:45:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123903#M33473</guid>
      <dc:creator>kishorksudha</dc:creator>
      <dc:date>2020-09-28T18:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join 3 Queries into one for usage in Dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123904#M33474</link>
      <description>&lt;P&gt;Hi kishorksudha. If Martin's answer was helpful, I suggest you click on "accept answer" and possibly vote up the answer as well. Furthermore, the preferred way of replying would be to comment on the answer, rather than posting a new answer.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Feb 2015 11:30:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123904#M33474</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2015-02-01T11:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join 3 Queries into one for usage in Dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123905#M33475</link>
      <description>&lt;P&gt;Thanks Martin &lt;BR /&gt;
It was very helpful and the assumption was right. &lt;/P&gt;

&lt;P&gt;Kishor&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 02:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-3-Queries-into-one-for-usage-in-Dashboard/m-p/123905#M33475</guid>
      <dc:creator>kishorksudha</dc:creator>
      <dc:date>2015-02-13T02:16:43Z</dc:date>
    </item>
  </channel>
</rss>

