<?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 Table command versus stats command for this search (for efficiency)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Table-command-versus-stats-command-for-this-search-for/m-p/299219#M90182</link>
    <description>&lt;P&gt;My Query is as follows &lt;BR /&gt;
index=x source=y   COMPLETED &lt;BR /&gt;
| stats values(process_key) as "Process Key", values(process_start_time) as "Process Start Time", values(job_key) as "Job Key", latest(job_status) as "Job Status" latest(process_status) as "Process Status",values(total_run_duration) as "Process Duration", values(duration_process_inprogress) as "InProgress Duration", values(job_detail_lastupdate) as "Last Update Time" by process_key,process_name,job_detail_key &lt;BR /&gt;
| rename process_name as "Process Name" &lt;BR /&gt;
| table "Process Start Time", "Last Update Time", "Process Name", "Process Key", "Job Key" "Process Status" "Job Status" "Process Duration" "InProgress Duration" &lt;BR /&gt;
| sort -"Process Start Time" &lt;BR /&gt;
| fillnull "Process Duration" value=Opened&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:11:49 GMT</pubDate>
    <dc:creator>delgendy</dc:creator>
    <dc:date>2020-09-29T16:11:49Z</dc:date>
    <item>
      <title>Table command versus stats command for this search (for efficiency)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-command-versus-stats-command-for-this-search-for/m-p/299219#M90182</link>
      <description>&lt;P&gt;My Query is as follows &lt;BR /&gt;
index=x source=y   COMPLETED &lt;BR /&gt;
| stats values(process_key) as "Process Key", values(process_start_time) as "Process Start Time", values(job_key) as "Job Key", latest(job_status) as "Job Status" latest(process_status) as "Process Status",values(total_run_duration) as "Process Duration", values(duration_process_inprogress) as "InProgress Duration", values(job_detail_lastupdate) as "Last Update Time" by process_key,process_name,job_detail_key &lt;BR /&gt;
| rename process_name as "Process Name" &lt;BR /&gt;
| table "Process Start Time", "Last Update Time", "Process Name", "Process Key", "Job Key" "Process Status" "Job Status" "Process Duration" "InProgress Duration" &lt;BR /&gt;
| sort -"Process Start Time" &lt;BR /&gt;
| fillnull "Process Duration" value=Opened&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-command-versus-stats-command-for-this-search-for/m-p/299219#M90182</guid>
      <dc:creator>delgendy</dc:creator>
      <dc:date>2020-09-29T16:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table command versus stats command for this search (for efficiency)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-command-versus-stats-command-for-this-search-for/m-p/299220#M90183</link>
      <description>&lt;P&gt;looking over your code, it looks pretty good. you can remove values(process_key) as "Process Key" since you are also using that in your by statement. You can use &lt;CODE&gt;fields&lt;/CODE&gt; instead of &lt;CODE&gt;table&lt;/CODE&gt;, if you're just using that to get them in the right order. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(process_start_time) as "Process Start Time", values(job_key) as "Job Key", latest(job_status) as "Job Status" latest(process_status) as "Process Status",values(total_run_duration) as "Process Duration", values(duration_process_inprogress) as "InProgress Duration", values(job_detail_lastupdate) as "Last Update Time" by process_key,process_name,job_detail_key 
| rename process_name as "Process Name" process_key as "Process Key"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 13:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-command-versus-stats-command-for-this-search-for/m-p/299220#M90183</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-06T13:35:37Z</dc:date>
    </item>
  </channel>
</rss>

