<?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 calculate date based upon a patch lot value. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420502#M191029</link>
    <description>&lt;P&gt;Use creates date_mday and date_wday field for all index. Use can use these fields.&lt;BR /&gt;
Below is an example using splunks internal index&lt;/P&gt;

&lt;P&gt;| tstats values(date_wday) as Day where index=_internal by date_mday &lt;BR /&gt;
| rename date_mday as date &lt;BR /&gt;
| sort date &lt;BR /&gt;
| eval dayFlag = ( floor((date/7)) ) + 1 &lt;BR /&gt;
| eval Message = date." is the ".dayFlag." ".Day." of the Month" &lt;BR /&gt;
| table Message&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:33:08 GMT</pubDate>
    <dc:creator>chinmoya</dc:creator>
    <dc:date>2020-09-30T01:33:08Z</dc:date>
    <item>
      <title>How to calculate date based upon a patch lot value.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420501#M191028</link>
      <description>&lt;P&gt;How can we apply below logic in splunk.&lt;/P&gt;

&lt;P&gt;We have the data in Splunk which is coming out as below.&lt;/P&gt;

&lt;P&gt;Host    Patching Lot&lt;BR /&gt;
A             Lot 1&lt;BR /&gt;
B             Lot2&lt;BR /&gt;
C             Lot 3&lt;/P&gt;

&lt;P&gt;Lets say &lt;BR /&gt;
Lot 1 means - First Sunday of Every Month&lt;BR /&gt;
Lot 2 means - First Saturday of Every month&lt;BR /&gt;
Lot 3 Means - Second Sunday of Every Month.&lt;/P&gt;

&lt;P&gt;How can we calculate the date corresponding to each lot for the current month.&lt;/P&gt;

&lt;P&gt;Required Output is &lt;/P&gt;

&lt;P&gt;Host    Patching Lot          Date&lt;BR /&gt;
A             Lot 1                   4- Aug (First Sunday of Aug)&lt;BR /&gt;
B             Lot2                    3- Aug (First Saturday of Aug)&lt;BR /&gt;
C             Lot 3                   11- Aug (Second Sunday of Aug.)&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 09:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420501#M191028</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-08-01T09:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate date based upon a patch lot value.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420502#M191029</link>
      <description>&lt;P&gt;Use creates date_mday and date_wday field for all index. Use can use these fields.&lt;BR /&gt;
Below is an example using splunks internal index&lt;/P&gt;

&lt;P&gt;| tstats values(date_wday) as Day where index=_internal by date_mday &lt;BR /&gt;
| rename date_mday as date &lt;BR /&gt;
| sort date &lt;BR /&gt;
| eval dayFlag = ( floor((date/7)) ) + 1 &lt;BR /&gt;
| eval Message = date." is the ".dayFlag." ".Day." of the Month" &lt;BR /&gt;
| table Message&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420502#M191029</guid>
      <dc:creator>chinmoya</dc:creator>
      <dc:date>2020-09-30T01:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate date based upon a patch lot value.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420503#M191030</link>
      <description>&lt;P&gt;Hi Chinmoy,&lt;/P&gt;

&lt;P&gt;Thanks for Responding.&lt;/P&gt;

&lt;P&gt;Your logic seems correct, but I need this information in date format. can we do so?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 08:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-date-based-upon-a-patch-lot-value/m-p/420503#M191030</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-08-05T08:43:49Z</dc:date>
    </item>
  </channel>
</rss>

