<?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: Inefficient Query - Same Base Query, Multiple Time Ranges  earliest -24h, -30d, -60d in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533073#M150596</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=sample sourcetype="SAMPLE:DATA" earliest=-90d@d latest=@d
| bin _time span=1d
| eval timeframe=case(_time&amp;lt;relative_time(now(), "-60d@d"), "90d", _time&amp;gt;relative_time(now(), "-60d@d") AND _time&amp;lt;relative_time(now(), "-30d@d"), "60d", _time&amp;gt;relative_time(now(), "-30d@d"), "30d", 1=1, "Other")
| stats dc(workstation_name) as EUD by timeframe, sitename&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 21:57:18 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2020-12-14T21:57:18Z</dc:date>
    <item>
      <title>Inefficient Query - Same Base Query, Multiple Time Ranges  earliest -24h, -30d, -60d</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533070#M150594</link>
      <description>&lt;P&gt;I need some suggestions on how to make this query more efficient.&amp;nbsp; We would like distinct count of workstation by sitename - with 3 columns of the count that shows within the past 24 hours, 30 days, and 60 days.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=sample sourcetype="SAMPLE:DATA" earliest=-24h&lt;/P&gt;&lt;P&gt;| stats dc(workstation_name) AS "Past 24 Hours EUD Count" by sitename&lt;/P&gt;&lt;P&gt;| appendcols&lt;/P&gt;&lt;P&gt;[ search index=sample sourcetype="SAMPLE:DATA" earliest=-30d&lt;/P&gt;&lt;P&gt;| stats dc(workstation_name) AS "Past 30 Days EUD Count" by sitename ]&lt;/P&gt;&lt;P&gt;| appendcols&lt;/P&gt;&lt;P&gt;[ search index=sample sourcetype="SAMPLE:DATA" earliest=-60d&lt;/P&gt;&lt;P&gt;| stats dc(workstation_name) AS "Past 60 Days EUD Count" by sitename ]&lt;/P&gt;&lt;P&gt;| appendcols&lt;/P&gt;&lt;P&gt;[ search index=sample sourcetype="SAMPLE:DATA" earliest=-90d&lt;/P&gt;&lt;P&gt;| stats dc(workstation_name) AS "Past 90 Days EUD Count" by sitename ]&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 20:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533070#M150594</guid>
      <dc:creator>splunkyj</dc:creator>
      <dc:date>2020-12-14T20:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Inefficient Query - Same Base Query, Multiple Time Ranges  earliest -24h, -30d, -60d</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533073#M150596</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=sample sourcetype="SAMPLE:DATA" earliest=-90d@d latest=@d
| bin _time span=1d
| eval timeframe=case(_time&amp;lt;relative_time(now(), "-60d@d"), "90d", _time&amp;gt;relative_time(now(), "-60d@d") AND _time&amp;lt;relative_time(now(), "-30d@d"), "60d", _time&amp;gt;relative_time(now(), "-30d@d"), "30d", 1=1, "Other")
| stats dc(workstation_name) as EUD by timeframe, sitename&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 21:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533073#M150596</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-12-14T21:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inefficient Query - Same Base Query, Multiple Time Ranges  earliest -24h, -30d, -60d</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533084#M150600</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/23295"&gt;@nickhills&lt;/a&gt;&amp;nbsp;, I would like to see the different count of time ranges in it's own column by sitename.&amp;nbsp; First column sitename, 2nd column count of the past 24 hours, 3rd column count of the past 30 days, 4th column count of the past 60 days, and 5th column count of the past 90 days. Thanks for your suggestion, I tried playing around with it - but I couldn't get the results I'm looking for. Let me know if you have another suggestion, I truly appreciate it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 00:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inefficient-Query-Same-Base-Query-Multiple-Time-Ranges-earliest/m-p/533084#M150600</guid>
      <dc:creator>splunkyj</dc:creator>
      <dc:date>2020-12-15T00:05:13Z</dc:date>
    </item>
  </channel>
</rss>

