<?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 to convert base search query that uses stats into a timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475924#M133722</link>
    <description>&lt;P&gt;Hi, I've swapped the base search and post-processing search and changed it to eventstats but then the base search will not display a chart since we can pick the visualization for stats but not eventstats?&lt;/P&gt;

&lt;P&gt;Basically, I need the base query to display a pie chart from  &lt;STRONG&gt;stats count by cs_host&lt;/STRONG&gt; and the post search query to display a timechart.   &lt;STRONG&gt;Timechart span=1h count(orderID) as Number_of_Orders&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:11:00 GMT</pubDate>
    <dc:creator>lsy9891</dc:creator>
    <dc:date>2020-09-30T02:11:00Z</dc:date>
    <item>
      <title>How to convert base search query that uses stats into a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475922#M133720</link>
      <description>&lt;P&gt;Hi, I want to display this query in my dashboard in two different charts.&lt;/P&gt;

&lt;P&gt;So this is my base search query:&lt;BR /&gt;
search base="OrderSearch"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=NETWEBA* sourcetype=iis NOT("ErrorGuid") (sc_status="2**" OR sc_status="3**") "GET" | rex field=cs_referer "https:\/\/[a-zA-Z]+\.[a-zA-Z]+\.([a-zA-Z]+|[a-zA-Z]+.[a-zA-Z]+)\/order20\/order\/confirmation-v2\/(?&amp;lt;orderID&amp;gt;[0-9]+)(.*)"  | dedup orderID |stats count by cs_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I want to display this in a different timechart:&lt;/P&gt;

&lt;P&gt;search id="OrderSearch"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timechart span=1h count(orderID) as Number_of_Orders
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried changing it to eventstats but it didn't work?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 07:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475922#M133720</guid>
      <dc:creator>lsy9891</dc:creator>
      <dc:date>2019-09-12T07:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert base search query that uses stats into a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475923#M133721</link>
      <description>&lt;P&gt;You have your search tags reversed.  The base search should use&lt;CODE&gt;id="OrderSearch"&lt;/CODE&gt; and the post-processing search should use &lt;CODE&gt;base="OrderSearch"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;That said, the &lt;CODE&gt;timesearch&lt;/CODE&gt; fails because it needs _time and orderID fields, neither of which come out of the base search because &lt;CODE&gt;stats&lt;/CODE&gt; filters fields to those explicitly mentioned.  &lt;CODE&gt;eventstats&lt;/CODE&gt; should fix that once the fix above is implemented.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 12:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475923#M133721</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-12T12:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert base search query that uses stats into a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475924#M133722</link>
      <description>&lt;P&gt;Hi, I've swapped the base search and post-processing search and changed it to eventstats but then the base search will not display a chart since we can pick the visualization for stats but not eventstats?&lt;/P&gt;

&lt;P&gt;Basically, I need the base query to display a pie chart from  &lt;STRONG&gt;stats count by cs_host&lt;/STRONG&gt; and the post search query to display a timechart.   &lt;STRONG&gt;Timechart span=1h count(orderID) as Number_of_Orders&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:11:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475924#M133722</guid>
      <dc:creator>lsy9891</dc:creator>
      <dc:date>2020-09-30T02:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert base search query that uses stats into a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475925#M133723</link>
      <description>&lt;P&gt;Base searches should not create visualizations.  Do the visualization in post-processing.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 12:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-base-search-query-that-uses-stats-into-a/m-p/475925#M133723</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-18T12:54:44Z</dc:date>
    </item>
  </channel>
</rss>

