<?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: splunk query to get data last two or three months in week range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582556#M202902</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;for this reason I hinted to schedule a search every Saturday putting results in a summary index!&lt;/P&gt;&lt;P&gt;It's not possible to define a bin period fixing the starting week day, but using my approach you'll have the wanted results.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 15:10:12 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-01-26T15:10:12Z</dc:date>
    <item>
      <title>splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582505#M202882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out how to get data for the past few weeks and data will be filtered.&lt;BR /&gt;&lt;BR /&gt;week start should be from every (previous week)Saturday to Friday.&lt;BR /&gt;&lt;BR /&gt;I will send a report every Friday.&lt;BR /&gt;&lt;BR /&gt;the report should be like this&lt;BR /&gt;&lt;BR /&gt;DATE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COUNT&amp;nbsp; &amp;nbsp; NAME&lt;BR /&gt;21-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 58&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;one&lt;BR /&gt;14-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 58&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;one&lt;BR /&gt;07-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;two&lt;BR /&gt;&lt;BR /&gt;Thus on next Friday one more value-added to report.&lt;BR /&gt;&lt;BR /&gt;DATE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COUNT&amp;nbsp; &amp;nbsp; NAME&lt;BR /&gt;28-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 61&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;one&lt;BR /&gt;21-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 58&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;one&lt;BR /&gt;14-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 58&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;one&lt;BR /&gt;07-01-22&amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;two&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 09:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582505#M202882</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-26T09:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582506#M202883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;there are more ways to do this, I hint the following.&lt;/P&gt;&lt;P&gt;you could schedule every Friday night (or better Saturday night to be sure to have all the events in Friday)&amp;nbsp;a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index earliest=-7d@d latest@d
| stats count AS COUNT latest(_time) AS DATE BY NAME
| collect index=my_summary_report&lt;/LI-CODE&gt;&lt;P&gt;and then run a search on the summary index:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_summary_report
| table DATE COUNT NAME&lt;/LI-CODE&gt;&lt;P&gt;using as time boundary the time you want.&lt;/P&gt;&lt;P&gt;In this way you have a very eficient search even if the first search is very slow.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 10:01:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582506#M202883</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-26T10:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582508#M202884</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;Thank you, Data I'm using from the summary index, I don't want to increase the memory of the summary index.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 10:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582508#M202884</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-26T10:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582513#M202886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the memory (disk storage) that you use in the hinted way is very very little!&lt;/P&gt;&lt;P&gt;Anyway, you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index earliest=-7d@d latest@d
| bin _time span=7d
| timechart count BY NAME
| rename count AS COUNT
| eval DATE=strftime(_time,"%d-%m-%y")
| table DATE COUNT NAME&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 10:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582513#M202886</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-26T10:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582526#M202890</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;Thank you, trying to run the below query giving&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest=-90d@d latest=now&lt;/LI-CODE&gt;&lt;P&gt;as I want data for the last three months&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;but it is giving a date in DATE field is Thursday(should be Friday),&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;DATE&amp;nbsp;&lt;BR /&gt;06-01-22&lt;BR /&gt;13-01-22&lt;BR /&gt;20-01-22&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 12:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582526#M202890</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-26T12:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582535#M202892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, if you run the search on Saturday, you'll have the count at Friday.&lt;/P&gt;&lt;P&gt;If you want to run the search on Friday, you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index earliest=-7d@d
| bin _time span=7d
| timechart count BY NAME
| rename count AS COUNT
| eval DATE=strftime(_time,"%d-%m-%y")
| table DATE COUNT NAME&lt;/LI-CODE&gt;&lt;P&gt;but, beware because you could not take all the events of Friday.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 13:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582535#M202892</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-26T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582544#M202895</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;it is not working as expected, I think as we kept span=7d in (days)&lt;BR /&gt;for example if&amp;nbsp; i run today, by putting span=7d&amp;nbsp; Date should be like&amp;nbsp;&lt;BR /&gt;DATE&lt;BR /&gt;26/01/22&lt;BR /&gt;19/01/22&lt;BR /&gt;12/01/22&lt;BR /&gt;&lt;BR /&gt;which we Wednesday of every week&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 14:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582544#M202895</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-26T14:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to get data last two or three months in week range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582556#M202902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;for this reason I hinted to schedule a search every Saturday putting results in a summary index!&lt;/P&gt;&lt;P&gt;It's not possible to define a bin period fixing the starting week day, but using my approach you'll have the wanted results.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-query-to-get-data-last-two-or-three-months-in-week-range/m-p/582556#M202902</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-26T15:10:12Z</dc:date>
    </item>
  </channel>
</rss>

