<?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 how to combine 2 separate queries and list there data in tabular format. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-separate-queries-and-list-there-data-in-tabular/m-p/522497#M147327</link>
    <description>&lt;P&gt;e.g&lt;/P&gt;&lt;P&gt;QUERY 1: host=jtcstcxbsswb* source="/usr/IBM/HTTPServer/logs/access*" httpmethod="GET" statuscode="200" loaninfo="/api*" OR Requestinfo="*/" OR sitename="*/LoginAccountUserName"&lt;/P&gt;&lt;P&gt;|eval APFields=split(loaninfo,"/")&lt;/P&gt;&lt;P&gt;|eval APNumOfFields=mvcount(APFields)&lt;/P&gt;&lt;P&gt;|eval AP2ndFromLast=mvindex(APFields,APNumOfFields-2)&lt;/P&gt;&lt;P&gt;|eval APLoanNumber=mvindex(APFields,6)&lt;/P&gt;&lt;P&gt;|eval APLast=mvindex(APFields,-1)&lt;/P&gt;&lt;P&gt;|search APLast="loans" OR APLast="summary" OR APLast="payments"&lt;/P&gt;&lt;P&gt;|timechart count(APLast), Avg(cookie) as URT&amp;nbsp; by APLast&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 2 :sourcetype=apigee:digit* host=JTCLSGLAPGERT* APIProduct=*-Authenticated-Product&lt;BR /&gt;|timechart span=5m distinct_count(LoginAccountUserName)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;i want something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;host=jtcstcxbsswb* source="/usr/IBM/HTTPServer/logs/access*" httpmethod="GET" statuscode="200" loaninfo="/api*"&amp;nbsp;&lt;/P&gt;&lt;P&gt;|eval APFields=split(loaninfo,"/")&lt;/P&gt;&lt;P&gt;|eval APNumOfFields=mvcount(APFields)&lt;/P&gt;&lt;P&gt;|eval AP2ndFromLast=mvindex(APFields,APNumOfFields-2)&lt;/P&gt;&lt;P&gt;|eval APLoanNumber=mvindex(APFields,6)&lt;/P&gt;&lt;P&gt;|eval APLast=mvindex(APFields,-1)&lt;/P&gt;&lt;P&gt;|search APLast="loans" OR APLast="summary" OR APLast="payments"&lt;/P&gt;&lt;P&gt;|stats count(APLast), Avg(cookie) as URT&amp;nbsp; by APLast&lt;/P&gt;&lt;P&gt;|append [search sourcetype=apigee:digit* host=JTCLSGLAPGERT* APIProduct=*-Authenticated-Product&lt;BR /&gt;|timechart span=5m distinct_count(LoginAccountUserName) ]&lt;BR /&gt;&amp;nbsp;|bin _time|stats count(APLast), Avg(cookie) as URT ,distinct_count(LoginAccountUserName) by APLast&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am able to get the data&amp;nbsp; as&amp;nbsp;&lt;BR /&gt;Time&amp;nbsp; | count(APLAST) | URT | LoginAccountUserName (I see only zero values in&amp;nbsp;LoginAccountUserName)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;how to fetch the LoginAccountUserName data from 2nd query and list it here.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 14:03:16 GMT</pubDate>
    <dc:creator>Aps17</dc:creator>
    <dc:date>2020-10-01T14:03:16Z</dc:date>
    <item>
      <title>how to combine 2 separate queries and list there data in tabular format.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-separate-queries-and-list-there-data-in-tabular/m-p/522497#M147327</link>
      <description>&lt;P&gt;e.g&lt;/P&gt;&lt;P&gt;QUERY 1: host=jtcstcxbsswb* source="/usr/IBM/HTTPServer/logs/access*" httpmethod="GET" statuscode="200" loaninfo="/api*" OR Requestinfo="*/" OR sitename="*/LoginAccountUserName"&lt;/P&gt;&lt;P&gt;|eval APFields=split(loaninfo,"/")&lt;/P&gt;&lt;P&gt;|eval APNumOfFields=mvcount(APFields)&lt;/P&gt;&lt;P&gt;|eval AP2ndFromLast=mvindex(APFields,APNumOfFields-2)&lt;/P&gt;&lt;P&gt;|eval APLoanNumber=mvindex(APFields,6)&lt;/P&gt;&lt;P&gt;|eval APLast=mvindex(APFields,-1)&lt;/P&gt;&lt;P&gt;|search APLast="loans" OR APLast="summary" OR APLast="payments"&lt;/P&gt;&lt;P&gt;|timechart count(APLast), Avg(cookie) as URT&amp;nbsp; by APLast&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 2 :sourcetype=apigee:digit* host=JTCLSGLAPGERT* APIProduct=*-Authenticated-Product&lt;BR /&gt;|timechart span=5m distinct_count(LoginAccountUserName)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;i want something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;host=jtcstcxbsswb* source="/usr/IBM/HTTPServer/logs/access*" httpmethod="GET" statuscode="200" loaninfo="/api*"&amp;nbsp;&lt;/P&gt;&lt;P&gt;|eval APFields=split(loaninfo,"/")&lt;/P&gt;&lt;P&gt;|eval APNumOfFields=mvcount(APFields)&lt;/P&gt;&lt;P&gt;|eval AP2ndFromLast=mvindex(APFields,APNumOfFields-2)&lt;/P&gt;&lt;P&gt;|eval APLoanNumber=mvindex(APFields,6)&lt;/P&gt;&lt;P&gt;|eval APLast=mvindex(APFields,-1)&lt;/P&gt;&lt;P&gt;|search APLast="loans" OR APLast="summary" OR APLast="payments"&lt;/P&gt;&lt;P&gt;|stats count(APLast), Avg(cookie) as URT&amp;nbsp; by APLast&lt;/P&gt;&lt;P&gt;|append [search sourcetype=apigee:digit* host=JTCLSGLAPGERT* APIProduct=*-Authenticated-Product&lt;BR /&gt;|timechart span=5m distinct_count(LoginAccountUserName) ]&lt;BR /&gt;&amp;nbsp;|bin _time|stats count(APLast), Avg(cookie) as URT ,distinct_count(LoginAccountUserName) by APLast&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am able to get the data&amp;nbsp; as&amp;nbsp;&lt;BR /&gt;Time&amp;nbsp; | count(APLAST) | URT | LoginAccountUserName (I see only zero values in&amp;nbsp;LoginAccountUserName)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;how to fetch the LoginAccountUserName data from 2nd query and list it here.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-separate-queries-and-list-there-data-in-tabular/m-p/522497#M147327</guid>
      <dc:creator>Aps17</dc:creator>
      <dc:date>2020-10-01T14:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine 2 separate queries and list there data in tabular format.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-separate-queries-and-list-there-data-in-tabular/m-p/522517#M147328</link>
      <description>&lt;P&gt;Looking at the last bits of the merged query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats count(APLast), Avg(cookie) as URT  by APLast
|append [search sourcetype=apigee:digit* host=JTCLSGLAPGERT* APIProduct=*-Authenticated-Product
  |timechart span=5m distinct_count(LoginAccountUserName) ]
|bin _time
|stats count(APLast), Avg(cookie) as URT ,distinct_count(LoginAccountUserName) by APLast&lt;/LI-CODE&gt;&lt;P&gt;we see that before the &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; we have results containing fields APLast, count(APLast), and URT.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; command produces additional results with fields _time, and distinct_count(LoginAccountUserName).&lt;/P&gt;&lt;P&gt;The final &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command then attempts to blend the two sets of results by the APLast field. but cannot do so because &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; did not return a field by that name.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;bin_time&lt;/FONT&gt; command is wasted since the final &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command does not use _time.&lt;/P&gt;&lt;P&gt;I hope that explains why you're not getting the expected results.&amp;nbsp; I can't offer a solution to the problem because I don't know your data well enough to determine how to relate LoginAccountUserName to anything else.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:54:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-separate-queries-and-list-there-data-in-tabular/m-p/522517#M147328</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-10-01T14:54:05Z</dc:date>
    </item>
  </channel>
</rss>

