<?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 I make a drill down report on one page? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609098#M211792</link>
    <description>&lt;P&gt;Main point about combining these to a single search is to do things the 'Splunk' way, i.e. not to use the join command, which has limitations, but instead join using the 'stats' command.&lt;/P&gt;&lt;P&gt;If you come from SQL, it's good to remember that with Splunk, the first option is NOT a join command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 00:58:36 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-08-11T00:58:36Z</dc:date>
    <item>
      <title>Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609089#M211786</link>
      <description>&lt;P&gt;I have 2 searches from two individual log files with Txid in common (could be outerjoin):&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first search I get the Txid from source file A and get the duration of that transaction.&lt;/P&gt;&lt;P&gt;The second search (I used Drilldown Editor to create a click event --&amp;gt;&amp;nbsp; &amp;nbsp;Set TxnId=$click.value$) is to retrieve appname, columns from a SQL statement,&amp;nbsp; host and by the selected Txnid.&lt;/P&gt;&lt;P&gt;I'd like to make these two outputs as one result.&amp;nbsp; How do I do it?&amp;nbsp; The exact syntaxes I used are as follows:&lt;/P&gt;&lt;P&gt;index="IDX"&amp;nbsp;&amp;nbsp; (host="PRhosts")&amp;nbsp; source="WS.webapi.log"&amp;nbsp;&amp;nbsp; "Controller.Post" "- End" | rex field=_raw "s/^.* {/{/" mode=sed&amp;nbsp; | spath output=status path=stat&amp;nbsp; |rex field=_raw "\s+T+\s(?&amp;lt;txid&amp;gt;.*?)\s+Controller\\.Post\s\\-\s(?&amp;lt;duration&amp;gt;.*?)\s\\-\s+End" |sort - duration |table txid duration&lt;/P&gt;&lt;P&gt;index="IDX"&amp;nbsp; (host="PRhosts") source="*WS.Business.Milestones.log" |rex field=_raw "s/^.* {/{/" mode=sed |spath output=nv path=flds{}.nv |spath output=status path=stat |spath output=tid path=tid |spath output=fn path=flds{}.fn | search tid=$Txnid$ | table fn nv host status tid&lt;/P&gt;&lt;P&gt;WS.Webapi.log raw date looks like one line below (and you can guess there is a - Begin somewhere above but there is no duration recorded):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;08/10/22 19:21:18.33 p06712 [00017] T M2kYTm7ywE6RFEnqc9m_1g Controller.Post - 00:00:00:270 - End&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WS.Business.Milestones.log&amp;nbsp; raw data look like the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;08/10/22 19:26:03.44 p08604 [00106] T {"tid":"H2R2JPpkiECRHW5hEszG3Q","sid":"T1-COOLSECURITY:CSAPPAUTH-{E7690AF7-D1F0-4A84-A612-7E47C9F07679}","stat":"Success","sf":"EmployeeLogic","sm":"GetAsync","dt":"2022-08-10T23:26:03.4462133Z","flds":[{"fn":"username","nv":"HostedRedirGlobalEmployeeWS_PR"},{"fn":"dbQueries","nv":"SQL_QUERIES=SELECT emp.EMP_ID, emp.REPORTS_TO_SCID, emp.DEPT_CODE , emp.EMP_ID\n FROM coolemp.SHIPS_COOL2 emp\n WHERE ((UPPER(emp.SYSTEM_PERSON_TYPE) != UPPER('Pending Worker'))) AND ((UPPER(emp.USER_SID) = UPPER(:emp_userSid)))"}]}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I'd like to know how to join the above 2 results into one so I can show the duration, with fn and nv values that has the SQL field "emp.Last_Updated_Date".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 23:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609089#M211786</guid>
      <dc:creator>rilee</dc:creator>
      <dc:date>2022-08-10T23:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609094#M211789</link>
      <description>&lt;P&gt;With the drilldown, if you go into the XML source, you can set any token for any field in the table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;drilldown&amp;gt;
  &amp;lt;set token="Txnid"&amp;gt;$row.txid$&amp;lt;/set&amp;gt;
  &amp;lt;set token="Duration"&amp;gt;$row.duration$&amp;lt;/set&amp;gt;
&amp;lt;/drilldown&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your drilldown setting it 'row'.&lt;/P&gt;&lt;P&gt;Do you actually want to do this with a drilldown or to have a single table with all information in it?&amp;nbsp; See this example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval r=split("08/10/22 19:21:18.33 p06712 [00017] T M2kYTm7ywE6RFEnqc9m_1g Controller.Post - 00:00:00:270 - End###08/10/22 19:26:03.44 p08604 [00106] T {\"tid\":\"H2R2JPpkiECRHW5hEszG3Q\",\"sid\":\"T1-COOLSECURITY:CSAPPAUTH-{E7690AF7-D1F0-4A84-A612-7E47C9F07679}\",\"stat\":\"Success\",\"sf\":\"EmployeeLogic\",\"sm\":\"GetAsync\",\"dt\":\"2022-08-10T23:26:03.4462133Z\",\"flds\":[{\"fn\":\"username\",\"nv\":\"HostedRedirGlobalEmployeeWS_PR\"},{\"fn\":\"dbQueries\",\"nv\":\"SQL_QUERIES=SELECT emp.EMP_ID, emp.REPORTS_TO_SCID, emp.DEPT_CODE , emp.EMP_ID\n FROM coolemp.SHIPS_COOL2 emp\n WHERE ((UPPER(emp.SYSTEM_PERSON_TYPE) != UPPER('Pending Worker'))) AND ((UPPER(emp.USER_SID) = UPPER(:emp_userSid)))\"}]}", "###")
| mvexpand r
| rename r as _raw
``` Above is setting up your example data ```

| rex field=_raw "\s+T+\s(?&amp;lt;txid&amp;gt;.*?)\s+Controller\\.Post\s\\-\s(?&amp;lt;duration&amp;gt;.*?)\s\\-\s+End"
| rex field=_raw "s/^.* {/{/" mode=sed 
| spath output=status path=stat 
| spath output=nv path=flds{}.nv 
| spath output=status path=stat 
| spath output=tid path=tid 
| spath output=fn path=flds{}.fn 
| eval txid=coalesce(txid, tid)
| stats values(*) as * by txid&lt;/LI-CODE&gt;&lt;P&gt;You would search both indexes with (search1) OR (search2) and then create the common field txid from the two data sets, then stats will 'join' them together - the above data has two different txids though.&lt;/P&gt;&lt;P&gt;As for&amp;nbsp;&lt;SPAN&gt;emp.Last_Updated_Date, if that data exists anywhere you can then extract that as needed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 00:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609094#M211789</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-11T00:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609096#M211790</link>
      <description>&lt;P&gt;No need for drill down any more.&amp;nbsp; That is just my initial practice to show in Dashboard through the drill down.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I meant to join the search results by txid.&amp;nbsp; I will try your syntax and then extract emp.Last_updated_Date from the combined data.&lt;/P&gt;&lt;P&gt;Sorry, my examples shown just to illustrate the formats of records, did not&amp;nbsp;pick the same txid.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 00:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609096#M211790</guid>
      <dc:creator>rilee</dc:creator>
      <dc:date>2022-08-11T00:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609098#M211792</link>
      <description>&lt;P&gt;Main point about combining these to a single search is to do things the 'Splunk' way, i.e. not to use the join command, which has limitations, but instead join using the 'stats' command.&lt;/P&gt;&lt;P&gt;If you come from SQL, it's good to remember that with Splunk, the first option is NOT a join command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 00:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609098#M211792</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-11T00:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609100#M211793</link>
      <description>&lt;P&gt;This new search syntax did not create any errors but did not return any results in the time frame that I knew 18 results should come back. What do I do wrong?&amp;nbsp; I believe the "OR" is the way to combine the raw data (2 log files) but perhaps it's fundamentally incorrect?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="IDX" (host="PRHosts") source="WS.Business.Milestones.log" OR "WS.webapi.log" "EmployeeController.Post" "- End"
| rex field=_raw "\s+T+\s(?&amp;lt;txid&amp;gt;.*?)\s+Controller\\.Post\s\\-\s(?&amp;lt;duration&amp;gt;.*?)\s\\-\s+End"
| rex field=_raw "s/^.* {/{/" mode=sed
| spath output=status path=stat
| spath output=nv path=flds{}.nv
| spath output=status path=stat
| spath output=tid path=tid
| spath output=fn path=flds{}.fn | eval fieldname=mvindex(fn,0)
| eval {fieldname}=mvindex(nv,0)
| eval fieldname=mvindex(fn,1)
| eval {fieldname}=mvindex(nv,1)
| fields - fn nv fieldname
| rex field=dbQueries "(?i)select\s+(?&amp;lt;columns&amp;gt;.*)\s+from"
| eval column=split(columns,", ")
| mvexpand column
| dedup column username | search status=Success column="emp.last_updated_date"
| eval txid=coalesce(txid, tid)
| stats values(*) as * by txid &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Aug 2022 01:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609100#M211793</guid>
      <dc:creator>rilee</dc:creator>
      <dc:date>2022-08-11T01:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609105#M211794</link>
      <description>&lt;P&gt;First search is not right.&lt;/P&gt;&lt;P&gt;You need to repeat the fields for the OR condition and use brackets where necessary, maybe this is what you intended?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="IDX" host="PRHosts") ((source="WS.Business.Milestones.log") OR (source="WS.webapi.log" "EmployeeController.Post" "- End"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND is implicit within terms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 01:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609105#M211794</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-11T01:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609108#M211795</link>
      <description>&lt;P&gt;The duration is not captured.&amp;nbsp; It works fine in (Search 1) when only used webapi log.&amp;nbsp; After combination, the txid is captured but duration field is null.&amp;nbsp; Why?&amp;nbsp;&lt;/P&gt;&lt;P&gt;| rex field=_raw "\s+T+\s(?&amp;lt;txid&amp;gt;.*?)\s+Controller\\.Post\s\\-\s(?&amp;lt;duration&amp;gt;.*?)\s\\-\s+End"&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 03:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609108#M211795</guid>
      <dc:creator>rilee</dc:creator>
      <dc:date>2022-08-11T03:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make a drill down report on one page?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609113#M211798</link>
      <description>&lt;P&gt;The final part of your search is out of order.&lt;/P&gt;&lt;P&gt;You are using dedup on column/username. If the data from search 1 does not have those fields, those events will disappear. Also you are searching status=success, which will only appear in search 2 data, so you should finish the search something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields - fn nv fieldname
...
| eval txid=coalesce(txid, tid)
| stats values(*) as * by txid 
``` Filter success items ```
| where status="Success"
``` Break out columns ```
| rex field=dbQueries "(?i)select\s+(?&amp;lt;columns&amp;gt;.*)\s+from"
| eval column=split(columns,", ")
``` Now get the column we want ```
| eval column = mvfilter(column="emp.last_updated_date")
| dedup column username &lt;/LI-CODE&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;combine the two event types&lt;/LI&gt;&lt;LI&gt;filter out success&lt;/LI&gt;&lt;LI&gt;rex out columns and split them&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is no point in mvexpand and then searching for the last_updated_date to remove all the other expanded columns, all you need to do it filter the one you want.&lt;/P&gt;&lt;P&gt;dedup may or may not be necessary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 05:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-make-a-drill-down-report-on-one-page/m-p/609113#M211798</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-11T05:10:04Z</dc:date>
    </item>
  </channel>
</rss>

