<?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 color the columns  based on previous column value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545098#M154357</link>
    <description>&lt;P&gt;&lt;SPAN&gt;| index=sample check=ERROR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| stats first(_time) as _time by SampleCode, Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| rex mode=sed field=Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"s/failed: //g&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/Order.ScenarioId/Order-ScenarioId/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/([0-9])[\.|\_]([0-9])/\1\2/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/[0-9]+//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/ / /"&lt;BR /&gt;| rex field=ComplianceAcknowledgementMessage "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"&lt;BR /&gt;| bin span=mon _time&lt;BR /&gt;| stats count by _time ResponseMsg&lt;BR /&gt;| sort ResponseMsg _time&lt;BR /&gt;| autoregress count as previousCount p=1&lt;BR /&gt;| autoregress ResponseMsg as previousMsg p=1&lt;BR /&gt;| eval sign=if(ResponseMsg=previousMsg,count-previousCount,null)&lt;BR /&gt;| eval sign = sign/abs(sign)&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eval sign=if(sign &amp;lt; 0, "RED", if(sign &amp;gt; 0, "GREEN", "YELLOW"))&lt;BR /&gt;| eval count=mvappend(count,sign)&lt;BR /&gt;| fields - sign previousCount previousMsg&lt;BR /&gt;| eval _time = strftime(_time,"%b %y")&lt;BR /&gt;| xyseries ResponseMsg _time count&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bg-color.PNG" style="width: 750px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13460iC91D7C30F7ECB8F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="bg-color.PNG" alt="bg-color.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you can see this the output i am getting and the its not coming in correct order Jan21 and Feb 21 should be coming at last&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 11:20:28 GMT</pubDate>
    <dc:creator>Vignesh-107</dc:creator>
    <dc:date>2021-03-24T11:20:28Z</dc:date>
    <item>
      <title>How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/538849#M152374</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="80px"&gt;Messages&lt;/TD&gt;&lt;TD width="45px"&gt;Nov 20&lt;/TD&gt;&lt;TD width="45px"&gt;Dec 20&lt;/TD&gt;&lt;TD width="42.5px"&gt;Jan 20&lt;/TD&gt;&lt;TD width="46.25px"&gt;Feb 20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 0&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px"&gt;Messge 1&lt;/TD&gt;&lt;TD width="45px"&gt;1&lt;/TD&gt;&lt;TD width="45px"&gt;3&lt;/TD&gt;&lt;TD width="42.5px"&gt;1&lt;/TD&gt;&lt;TD width="46.25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 2&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;11&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 3&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 4&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;9&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;5&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 5&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 6&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="80px" height="22px"&gt;Messge 7&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="45px" height="22px"&gt;1&lt;/TD&gt;&lt;TD width="42.5px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="46.25px" height="22px"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here i want to color the columns background based on previous column value&lt;/P&gt;&lt;P&gt;Nov 20 Dec 20&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;0&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;1(green bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;11&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;0(red bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;1&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;0(red bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;9&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;5(red bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;1&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;1(yellow bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="43px"&gt;1&lt;/TD&gt;&lt;TD width="72.5px" height="43px"&gt;1(yellow bg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="45px" height="22px"&gt;0&lt;/TD&gt;&lt;TD width="72.5px" height="22px"&gt;1(green bg)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Comparing condtions&lt;BR /&gt;if the current values is more than previous column value then it should have a green-background&lt;BR /&gt;if the current values is less than previous column value then it should have a red-background&lt;BR /&gt;if the current values is equal to previous column value then it should have a yellow-background&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 04:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/538849#M152374</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-02-06T04:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/538879#M152390</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel depends="$stayhidden$"&amp;gt;
      &amp;lt;title&amp;gt;Colour based on previous&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #tableCellColourWithoutJS table tbody td div.multivalue-subcell[data-mv-index="1"]{
            display: none;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="tableCellColourWithoutJS"&amp;gt;
        &amp;lt;title&amp;gt;Colour Cell by Previous&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval _raw="Messages	Nov_20	Dec_20	Jan_21	Feb_21
Messge 0	0       1       0     0
Messge 1	1       3       1     1
Messge 2	11      0       0     0
Messge 3	1       0       0     0
Messge 4	9       5       0     0
Messge 5	1       1       0     0
Messge 6	1       1       0     0
Messge 7	0       1       0     0"
| multikv forceheader=1
| fields - _raw _time linecount
| fields - _mkv*
| transpose 0 header_field=Messages column_name=Month
| eval Month=strptime(Month . "_01", "%b_%y_%d")
| sort - Month
| autoregress Month as next p=1
| eval months=mvappend(Month, next)
| fields - next
| mvexpand months
| stats list(*) as * by months
| where months != "months"
| foreach *
  [ eval sign=(tonumber(mvindex('&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;',0)) - tonumber(mvindex('&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;', 1)))
  | eval sign = sign / abs(sign)
  | fillnull value=0 sign
  | eval sign=if(sign &amp;amp;lt; 0, "RED", if(sign &amp;amp;gt; 0, "GREEN", "YELLOW"))
  | eval &amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;=mvappend(mvindex('&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;', 0),sign)
  | fields - sign ]
| fields - months
| eval Month=mvindex(Month,0)
| sort Month
| eval Month=strftime(Month, "%b %y")
| transpose 0 header_field=Month column_name=Messages&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format type="color"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;case (match(value,"RED"), "#ff0000",match(value,"YELLOW"), "#ffff00",match(value,"GREEN"),"#00ff00",true(),"#ffffff")&amp;lt;/colorPalette&amp;gt;
        &amp;lt;/format&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hidden panel sets up the style to hide the second multi-value on each row (which contains the required colour).&lt;/P&gt;&lt;P&gt;The first part of the query sets up your example data - I assumed you meant Jan and Feb 21 not 20&lt;/P&gt;&lt;P&gt;By parsing the month to epoch time format it can then be used to sort&lt;/P&gt;&lt;P&gt;Getting the next month allows it to be "joined" with the previous month with the stats command so each month has the previous months value for each message&lt;/P&gt;&lt;P&gt;For each field, evaluate if the value for the message is greater or less or equal to previous month's value and set colour accordingly&lt;/P&gt;&lt;P&gt;Sort by month again, then format to shown date format&lt;/P&gt;&lt;P&gt;Finally, convert back to desired table layout&lt;/P&gt;&lt;P&gt;Set colour palette according to value of (hidden) field&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1612694217279.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12839i7896B739C9E0E609/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1612694217279.png" alt="ITWhisperer_0-1612694217279.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 10:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/538879#M152390</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-07T10:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539131#M152493</link>
      <description>&lt;P&gt;Its working fine with the'| makeresults' but the column with months are dynamic based on the time range we select . Is it possible to apply the same&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 10:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539131#M152493</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-02-09T10:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539134#M152495</link>
      <description>&lt;P&gt;The short answer to your question is yes it is possible.&lt;/P&gt;&lt;P&gt;Everything before the first transpose is to set up the data. It looks like you have got the data from a chart command, so the first transpose is to flip the data so that the rows are based on the dates. I suspect your data may already be available in this format or something close to it so perhaps this part can be changed by removing or at least moving your chart command until after the autoregress and determining whether the value is increasing or decreasing. Without seeing your actual query, it is difficult to tell you how to refactor it though.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The essential elements of my suggestion that you would probably need to use are the converting the date to epoch format so it can be sorted (although you may already have the date in this format), the autoregress to get the previous month, the result in the second element of the multi-value fields, the colouring based on that element and the hiding of that result using the stylesheet.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 10:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539134#M152495</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-09T10:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539201#M152520</link>
      <description>&lt;P&gt;&amp;nbsp;This the query i am trying to use&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| index=sample check=ERROR&lt;BR /&gt;| stats first(_time) as _time by SampleCode, Message&lt;BR /&gt;| rex mode=sed field=Message&lt;BR /&gt;"s/failed: //g&lt;BR /&gt;s/Order.ScenarioId/Order-ScenarioId/&lt;BR /&gt;s/([0-9])[\.|\_]([0-9])/\1\2/&lt;BR /&gt;s/[0-9]+//&lt;BR /&gt;s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g&lt;BR /&gt;s/ / /"&lt;BR /&gt;| rex field=Message "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"&lt;BR /&gt;| timechart span=mon limit=0 count by ResponseMsg&lt;BR /&gt;| fields - _span, _spandays&lt;BR /&gt;| eval _time = strftime(_time,"%b %y")&lt;BR /&gt;| transpose 0 header_field=_time, column_name=ResponseMsg&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 16:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539201#M152520</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-02-09T16:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539206#M152521</link>
      <description>&lt;P&gt;A lot easier working from uncharted data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| index=sample check=ERROR
| stats first(_time) as _time by SampleCode, Message
| rex mode=sed field=Message
"s/failed: //g
s/Order.ScenarioId/Order-ScenarioId/
s/([0-9])[\.|\_]([0-9])/\1\2/
s/[0-9]+//
s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g
s/ / /"
| rex field=Message "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"
| bin span=mon _time
| stats count by _time ResponseMsg
| sort ResponseMsg _time
| autoregress count as previousCount p=1
| autoregress ResponseMsg as previousMsg p=1
| eval sign=if(ResponseMsg=previousMsg,count-previousCount,null)
| eval sign = sign/abs(sign)
| fillnull value=0 sign
| eval sign=if(sign &amp;amp;lt; 0, "RED", if(sign &amp;amp;gt; 0, "GREEN", "YELLOW"))
| eval count=mvappend(count,sign)
| fields - sign previousCount previousMsg
| eval _time = strftime(_time,"%b %y")
| xyseries ResponseMsg _time count&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 17:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/539206#M152521</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-09T17:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545090#M154354</link>
      <description>&lt;P&gt;Yes i have tried it but i am not getting the expected thing i am getting most of the columns as empty&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 10:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545090#M154354</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-03-24T10:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545094#M154355</link>
      <description>&lt;P&gt;Can you share what you have tried to see if we can spot what might be wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 11:04:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545094#M154355</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-24T11:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545098#M154357</link>
      <description>&lt;P&gt;&lt;SPAN&gt;| index=sample check=ERROR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| stats first(_time) as _time by SampleCode, Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| rex mode=sed field=Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"s/failed: //g&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/Order.ScenarioId/Order-ScenarioId/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/([0-9])[\.|\_]([0-9])/\1\2/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/[0-9]+//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s/ / /"&lt;BR /&gt;| rex field=ComplianceAcknowledgementMessage "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"&lt;BR /&gt;| bin span=mon _time&lt;BR /&gt;| stats count by _time ResponseMsg&lt;BR /&gt;| sort ResponseMsg _time&lt;BR /&gt;| autoregress count as previousCount p=1&lt;BR /&gt;| autoregress ResponseMsg as previousMsg p=1&lt;BR /&gt;| eval sign=if(ResponseMsg=previousMsg,count-previousCount,null)&lt;BR /&gt;| eval sign = sign/abs(sign)&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eval sign=if(sign &amp;lt; 0, "RED", if(sign &amp;gt; 0, "GREEN", "YELLOW"))&lt;BR /&gt;| eval count=mvappend(count,sign)&lt;BR /&gt;| fields - sign previousCount previousMsg&lt;BR /&gt;| eval _time = strftime(_time,"%b %y")&lt;BR /&gt;| xyseries ResponseMsg _time count&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bg-color.PNG" style="width: 750px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13460iC91D7C30F7ECB8F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="bg-color.PNG" alt="bg-color.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you can see this the output i am getting and the its not coming in correct order Jan21 and Feb 21 should be coming at last&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 11:20:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545098#M154357</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-03-24T11:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545140#M154375</link>
      <description>&lt;P&gt;The issue is the eval _time to a string before the xyseries so the order is not by epoch time.&amp;nbsp; However, if you remove this, the columns in the xyseries become numbers (the epoch time). To resolve this without disrupting the order is to use transpose twice, renaming the column values in between.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| index=sample check=ERROR
| stats first(_time) as _time by SampleCode, Message
| rex mode=sed field=Message
"s/failed: //g
s/Order.ScenarioId/Order-ScenarioId/
s/([0-9])[\.|\_]([0-9])/\1\2/
s/[0-9]+//
s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g
s/ / /"
| rex field=ComplianceAcknowledgementMessage "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"
| bin span=mon _time
| stats count by _time ResponseMsg
| sort ResponseMsg _time
| autoregress count as previousCount p=1
| autoregress ResponseMsg as previousMsg p=1
| eval sign=if(ResponseMsg=previousMsg,count-previousCount,null)
| eval sign = sign/abs(sign)
| fillnull value=0
| eval sign=if(sign &amp;lt; 0, "RED", if(sign &amp;gt; 0, "GREEN", "YELLOW"))
| eval count=mvappend(count,sign)
| fields - sign previousCount previousMsg
| xyseries ResponseMsg _time count
| transpose 0 header_field=ResponseMsg
| eval column=strftime(column,"%Y-%m")
| transpose 0 header_field=column column_name=ResponseMsg&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 14:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545140#M154375</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-24T14:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545596#M154578</link>
      <description>&lt;P&gt;Tried with the query you gave but its not working as expected, When i check for last 30 days of data we are seeing most empty for Feb month and colors need to be applied based on previous months data. But we are seeing the yellow colors Bg-color on March month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="30days.PNG" style="width: 424px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13507iE7C34D3A3868B7DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="30days.PNG" alt="30days.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the Feb and March data&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Feb and Mar.PNG" style="width: 175px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13508i7858C5F2A4437412/image-size/large?v=v2&amp;amp;px=999" role="button" title="Feb and Mar.PNG" alt="Feb and Mar.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 13:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545596#M154578</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-03-26T13:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545603#M154581</link>
      <description>&lt;P&gt;Can you share your current query?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545603#M154581</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-26T14:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545616#M154588</link>
      <description>&lt;P&gt;The same query that you gave above&lt;BR /&gt;&lt;BR /&gt;| index=sample check=ERROR&lt;BR /&gt;| stats first(_time) as _time by SampleCode, Message&lt;BR /&gt;| rex mode=sed field=Message&lt;BR /&gt;"s/failed: //g&lt;BR /&gt;s/Order.ScenarioId/Order-ScenarioId/&lt;BR /&gt;s/([0-9])[\.|\_]([0-9])/\1\2/&lt;BR /&gt;s/[0-9]+//&lt;BR /&gt;s/(PREOK)?(ID)?([A-Z]+_[A-Z]+_?[A-Z]+)?(\b([A-Z]{1,}\b))?/\1\2\3/g&lt;BR /&gt;s/ / /"&lt;BR /&gt;| rex field=ComplianceAcknowledgementMessage "^(?&amp;lt;ResponseMsg&amp;gt;[ a-zA-Z \-,]+)"&lt;BR /&gt;| bin span=mon _time&lt;BR /&gt;| stats count by _time ResponseMsg&lt;BR /&gt;| sort ResponseMsg _time&lt;BR /&gt;| autoregress count as previousCount p=1&lt;BR /&gt;| autoregress ResponseMsg as previousMsg p=1&lt;BR /&gt;| eval sign=if(ResponseMsg=previousMsg,count-previousCount,null)&lt;BR /&gt;| eval sign = sign/abs(sign)&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eval sign=if(sign &amp;lt; 0, "RED", if(sign &amp;gt; 0, "GREEN", "YELLOW"))&lt;BR /&gt;| eval count=mvappend(count,sign)&lt;BR /&gt;| fields - sign previousCount previousMsg&lt;BR /&gt;| xyseries ResponseMsg _time count&lt;BR /&gt;| transpose 0 header_field=ResponseMsg&lt;BR /&gt;| eval column=strftime(column,"%Y-%m")&lt;BR /&gt;| transpose 0 header_field=column column_name=ResponseMsg&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545616#M154588</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-03-26T14:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545620#M154591</link>
      <description>&lt;P&gt;And what query did you use to get the Feb and March data you posted?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545620#M154591</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-26T15:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the columns  based on previous column value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545680#M154622</link>
      <description>&lt;P&gt;The query i gave above bring the result which is check for last 30 days of data&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 08:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-color-the-columns-based-on-previous-column-value/m-p/545680#M154622</guid>
      <dc:creator>Vignesh-107</dc:creator>
      <dc:date>2021-03-27T08:31:20Z</dc:date>
    </item>
  </channel>
</rss>

