<?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: replace field name with variable month value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551551#M38136</link>
    <description>&lt;P&gt;Just repeat the calculation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| gentimes start=-90
| rename starttime as _time 
| fields _time
| streamstats count as row
| eval STATO_SEGN=mvindex(split("ABCDE",""),row%5)
| eval CST=_time
| eval IMA=relative_time(now(),"-0mon@mon")
| eval FMP=relative_time(IMA,"-1d@d"), NFMP=strftime(FMP,"%B")
| eval DAMA=if(CST&amp;gt;=IMA,1,0)
| stats sum(DAMA) as CURRENT_MONTH by STATO_SEGN
| transpose 13 column_name=STATO_SEGN header_field=STATO_SEGN
| eval STATO_SEGN=strftime(relative_time(now(),"-0mon@mon-1d"),"%B")&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 14 May 2021 07:31:46 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-05-14T07:31:46Z</dc:date>
    <item>
      <title>replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551547#M38133</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;BR /&gt;I did a search to change the name of the field with the value of another field (| eval {entity} = "bar") but it is not good for my search, it also displays the events only with | makeresults which is not good for me .&lt;BR /&gt;I would like to rename the camp based on the month we are in.&lt;BR /&gt;this is my query:&lt;/P&gt;&lt;P&gt;index=ala * sourcetype=segn&lt;BR /&gt;|fields - _*&lt;BR /&gt;|search NOT STATO_WFS_LA IN("6261","11084")&lt;BR /&gt;|eval CST=strptime(CAMBIO_STATO, "%Y-%m-%d")&lt;BR /&gt;|eval IMA=relative_time(now(), "-0mon@mon")&lt;BR /&gt;|eval FMP=relative_time(IMA, "-1d@d"), NFMP=strftime(FMP,"%B")&lt;BR /&gt;|eval DAMA = if(CST&amp;gt;=IMA,1,0)&lt;BR /&gt;|stats sum(DAMA) as CURRENT_MONTH by STATO_SEGN&lt;BR /&gt;|transpose 13 column_name=STATO_SEGN header_field=STATO_SEGN&lt;BR /&gt;&lt;BR /&gt;I would like CURRENT_MONTH to become May or June based on the NFMP variable.&lt;BR /&gt;It's possible?&lt;BR /&gt;I am looking and trying various solutions, to no avail &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;Tks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 07:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551547#M38133</guid>
      <dc:creator>antonio147</dc:creator>
      <dc:date>2021-05-14T07:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551551#M38136</link>
      <description>&lt;P&gt;Just repeat the calculation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| gentimes start=-90
| rename starttime as _time 
| fields _time
| streamstats count as row
| eval STATO_SEGN=mvindex(split("ABCDE",""),row%5)
| eval CST=_time
| eval IMA=relative_time(now(),"-0mon@mon")
| eval FMP=relative_time(IMA,"-1d@d"), NFMP=strftime(FMP,"%B")
| eval DAMA=if(CST&amp;gt;=IMA,1,0)
| stats sum(DAMA) as CURRENT_MONTH by STATO_SEGN
| transpose 13 column_name=STATO_SEGN header_field=STATO_SEGN
| eval STATO_SEGN=strftime(relative_time(now(),"-0mon@mon-1d"),"%B")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 May 2021 07:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551551#M38136</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-14T07:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551556#M38139</link>
      <description>&lt;P&gt;Hello IT Whispeper,&lt;BR /&gt;Thank you for your suggestion,&lt;BR /&gt;but if instead of just the previous month I also have other lines of the past months like 2 months ago, 3 months ago, 4 months ago?&lt;BR /&gt;How can I do?&lt;/P&gt;&lt;P&gt;for example&lt;BR /&gt;STATUS_SIGN&amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp;C&lt;BR /&gt;April&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&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;March&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&amp;nbsp; &amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;BR /&gt;February&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;.&lt;BR /&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 07:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551556#M38139</guid>
      <dc:creator>antonio147</dc:creator>
      <dc:date>2021-05-14T07:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551558#M38140</link>
      <description>&lt;P&gt;I think I have solved,&lt;BR /&gt;I insert a case&lt;/P&gt;&lt;P&gt;| eval SIGN_STATE = case (&lt;BR /&gt;SIGN_STATE = "N_1", strftime (relative_time (now (), "- 0mon @ mon-1d"), "% B"),&lt;BR /&gt;SIGN_STATE = "N_2", strftime (relative_time (now (), "- 2mon @ mon-1d"), "% B"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 08:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551558#M38140</guid>
      <dc:creator>antonio147</dc:creator>
      <dc:date>2021-05-14T08:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551570#M38142</link>
      <description>&lt;LI-CODE lang="markup"&gt;| gentimes start=-90
| rename starttime as _time 
| fields _time
| streamstats count as row
| eval STATO_SEGN=mvindex(split("ABCDE",""),row%5)
| eval CST=_time
| bin span=1mon CST
| chart count by CST STATO_SEGN
| eval STATO_SEGN=strftime(CST,"%B")
| fields - CST
| table STATO_SEGN *&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 May 2021 09:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551570#M38142</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-14T09:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551571#M38143</link>
      <description>&lt;P&gt;I had also thought about using CST.&lt;BR /&gt;As you suggested, the SIGN_STATE field is empty&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 09:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551571#M38143</guid>
      <dc:creator>antonio147</dc:creator>
      <dc:date>2021-05-14T09:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: replace field name with variable month value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551572#M38144</link>
      <description>&lt;P&gt;I believe that after the stats command the CST variable no longer exists&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 09:41:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-field-name-with-variable-month-value/m-p/551572#M38144</guid>
      <dc:creator>antonio147</dc:creator>
      <dc:date>2021-05-14T09:41:58Z</dc:date>
    </item>
  </channel>
</rss>

