<?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 assign previous month's fetched result to current month's field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613403#M213181</link>
    <description>&lt;P&gt;Here's an untested idea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats window=2 first(greater_6_mon) as prev
| fillnull value=0 prev&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;streamstats&lt;/FONT&gt; command computes stats on results as they're generated.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;window=2&lt;/FONT&gt; option says to look only at the current event and the one preceding it.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;first&lt;/FONT&gt; function takes the greater_6_mon value from the previous event and stores it in the prev field of the current event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:21:52 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-09-16T13:21:52Z</dc:date>
    <item>
      <title>How to assign previous month's fetched result to current month's field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613367#M213169</link>
      <description>&lt;P&gt;Considering 2022-06 as starting month,&amp;nbsp;&lt;BR /&gt;If month is 2022-07, i should assign 2022-06's corresponding field&amp;nbsp;values " greater_6_mon" to 2022-07's field "prev" , likewise to 2022-08 as well&lt;/P&gt;
&lt;P&gt;Here are my values :&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;month&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prev&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; greater_6_mon&lt;BR /&gt;2022-06&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 26&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2022-07&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2022-08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;expected result: (please suggest)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;month&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prev&amp;nbsp; &amp;nbsp; &amp;nbsp; greater_6_mon&lt;BR /&gt;2022-06&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2022-07&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2022-08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613367#M213169</guid>
      <dc:creator>spoo</dc:creator>
      <dc:date>2022-09-16T14:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613403#M213181</link>
      <description>&lt;P&gt;Here's an untested idea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats window=2 first(greater_6_mon) as prev
| fillnull value=0 prev&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;streamstats&lt;/FONT&gt; command computes stats on results as they're generated.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;window=2&lt;/FONT&gt; option says to look only at the current event and the one preceding it.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;first&lt;/FONT&gt; function takes the greater_6_mon value from the previous event and stores it in the prev field of the current event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613403#M213181</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-09-16T13:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613694#M213290</link>
      <description>&lt;P&gt;This worked fine but it is taking preceding value but I am expecting previous values of previous month.&amp;nbsp;&lt;BR /&gt;Example :&lt;BR /&gt;My values :&lt;/P&gt;&lt;TABLE width="266"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="37"&gt;team&lt;/TD&gt;&lt;TD width="64"&gt;month&lt;/TD&gt;&lt;TD width="101"&gt;prev&lt;/TD&gt;&lt;TD width="64"&gt;greater_6_mon&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2022-07&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2022-07&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;2022-07&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;2022-07&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="266"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="37"&gt;team&lt;/TD&gt;&lt;TD width="64"&gt;month&lt;/TD&gt;&lt;TD width="101"&gt;prev&lt;/TD&gt;&lt;TD width="64"&gt;greater_6_mon&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2022-08&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2022-08&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;2022-08&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;2022-08&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Here my greater_6mon of 2022-07 has been assigned to prev of 2022-08. Thats my intention to achieve.&lt;BR /&gt;Please suggest&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613694#M213290</guid>
      <dc:creator>spoo</dc:creator>
      <dc:date>2022-09-20T06:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613698#M213291</link>
      <description>&lt;P&gt;Simplest option is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| autoregress greater_6_mon as prev&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613698#M213291</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-20T06:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613699#M213292</link>
      <description>&lt;P&gt;Your initial post didn't seem to have enough information, as you also want to do that by 'Team', in which case you will need to use streamstats, as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;states, however, you will need to modify it slightly to take account of the team split, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats window=1 current=f global=f first(greater_6_mon) as prev by team
| fillnull value=0 prev&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:19:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613699#M213292</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-20T06:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613711#M213298</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;. This worked perfectly as intended. Great learning!!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613711#M213298</guid>
      <dc:creator>spoo</dc:creator>
      <dc:date>2022-09-20T06:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign previous month's fetched result to current month's field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613713#M213299</link>
      <description>&lt;P&gt;Thank you soo much, worked according to my initial requirement.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-assign-previous-month-s-fetched-result-to-current-month-s/m-p/613713#M213299</guid>
      <dc:creator>spoo</dc:creator>
      <dc:date>2022-09-20T06:59:26Z</dc:date>
    </item>
  </channel>
</rss>

