<?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: How can I create a search with the stats command which  breaks up results into separate rows? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-search-with-the-stats-command-which-breaks-up/m-p/420067#M120769</link>
    <description>&lt;P&gt;try using the below stats commad-&lt;/P&gt;

&lt;P&gt;stats  values(src) as src, values(dest) as dest, values(action) as action earliest(_time) as First, latest(_time) as Last by url&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:34:28 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2020-09-29T21:34:28Z</dc:date>
    <item>
      <title>How can I create a search with the stats command which  breaks up results into separate rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-search-with-the-stats-command-which-breaks-up/m-p/420066#M120768</link>
      <description>&lt;P&gt;Trying to create a query that would search two different network logs (firewall and proxy) and return results. The results would be displayed with a count by URL. The issue I'm having is that it's returning all the results in one row when I want individual URLs in each of their own individual rows with their corresponding fields including first and last time to that URL. &lt;/P&gt;

&lt;P&gt;So the count is pulling ALL URLs rather than each individual one. It's definitely something with the stats command but I can't seem to tweak it to make it work.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=firewall OR index=proxy) (sourcetype=fwlog OR sourcetype=proxylog) (dest=* OR DestinationIP=*) (src=8.8.8.8 OR SourceIP=8.8.8.8) (url="*" OR URL="*")
| eval url = coalesce(url,URL) 
| eval action = coalesce(action,Action) 
| eval src = coalesce(src,SourceIP)
| eval dest = coalesce(dest,DestinationIP)
| stats values(url) AS URLs count earliest(_time) AS First latest(_time) AS Last by src dest action 
| fields src dest action URLs count First Last
| convert timeformat="%Y-%m-%d %T" ctime(First) ctime(Last)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Oct 2018 18:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-search-with-the-stats-command-which-breaks-up/m-p/420066#M120768</guid>
      <dc:creator>showard22</dc:creator>
      <dc:date>2018-10-08T18:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a search with the stats command which  breaks up results into separate rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-search-with-the-stats-command-which-breaks-up/m-p/420067#M120769</link>
      <description>&lt;P&gt;try using the below stats commad-&lt;/P&gt;

&lt;P&gt;stats  values(src) as src, values(dest) as dest, values(action) as action earliest(_time) as First, latest(_time) as Last by url&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-search-with-the-stats-command-which-breaks-up/m-p/420067#M120769</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2020-09-29T21:34:28Z</dc:date>
    </item>
  </channel>
</rss>

