<?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 Time Field Coloring in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656163#M17241</link>
    <description>&lt;DIV&gt;I audit windows computers. My search looks for the date, time, EventCode and Account_Name:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EventCode&amp;nbsp; Account_Name&lt;/DIV&gt;&lt;DIV&gt;2023/08/29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16:09:30&amp;nbsp; &amp;nbsp; &amp;nbsp;4624&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsmith&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I would like the Time field to turn red when a user signs in after hours (1800 - 0559).&lt;/DIV&gt;&lt;DIV&gt;I have tried clicking on the pen in the time column and selecting Color than Ranges. I always get error messages about not putting the numbers in correct order.&lt;/DIV&gt;&lt;DIV&gt;What do I need to do?&lt;/DIV&gt;</description>
    <pubDate>Wed, 30 Aug 2023 22:28:34 GMT</pubDate>
    <dc:creator>sswigart</dc:creator>
    <dc:date>2023-08-30T22:28:34Z</dc:date>
    <item>
      <title>Time Field Coloring</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656163#M17241</link>
      <description>&lt;DIV&gt;I audit windows computers. My search looks for the date, time, EventCode and Account_Name:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EventCode&amp;nbsp; Account_Name&lt;/DIV&gt;&lt;DIV&gt;2023/08/29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16:09:30&amp;nbsp; &amp;nbsp; &amp;nbsp;4624&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsmith&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I would like the Time field to turn red when a user signs in after hours (1800 - 0559).&lt;/DIV&gt;&lt;DIV&gt;I have tried clicking on the pen in the time column and selecting Color than Ranges. I always get error messages about not putting the numbers in correct order.&lt;/DIV&gt;&lt;DIV&gt;What do I need to do?&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Aug 2023 22:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656163#M17241</guid>
      <dc:creator>sswigart</dc:creator>
      <dc:date>2023-08-30T22:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Time Field Coloring</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656173#M17242</link>
      <description>&lt;P&gt;You will have to the the use the colorPalette expression syntax as in the example below - you can simply copy this XML row into an existing dashboard to see how it works - it's a dummy search that just creates a random time and when it's in the out of hours range it goes red.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Turning the Time column red if outside hours 18:00 to 06:00&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
| eval _time=now() - (random() % 86400)
| eval Date=strftime(_time, "%F"), Time=strftime(_time, "%T")
| eval EventCode=4624, Account_Name="user ".(random() % 10)
| table Date Time EventCode Account_Name&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;100&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" field="Time"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;if(tonumber(substr(value,1,2))&amp;amp;gt;=18 OR tonumber(substr(value,1,2))&amp;amp;lt;6, "#FF0000", "#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;</description>
      <pubDate>Wed, 30 Aug 2023 23:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656173#M17242</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-30T23:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Time Field Coloring</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656885#M17309</link>
      <description>&lt;DIV&gt;bowesmana'&lt;/DIV&gt;&lt;DIV&gt;Thank you for your response. I am new to Splunk. I do not understand all the code you provided. My next question is how do I incorporate the actual search using your code.&amp;nbsp; Here is the search:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;index="winlogs" host=* source="WinEventLog:Security" Eventcode=4624 Logon_Type=2 OR Logon_Type=7 NOT dest_nt_domain="Window Manager" NOT dest_nt_domain="Font Driver Host"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;| sort_time&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;| convert ctime(_time) as timestamp&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;| table, timestamp,EventCode,Logon_Type,Account_Name,RecordNumber,status&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656885#M17309</guid>
      <dc:creator>sswigart</dc:creator>
      <dc:date>2023-09-06T21:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Time Field Coloring</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656888#M17310</link>
      <description>&lt;P&gt;My example was XML for use in a classic dashboard - so if you take the entire XML below and create a new dashboard and paste in this into the source.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard version="1.1"&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Turning the Time column red if outside hours 18:00 to 06:00&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
index="winlogs" host=* source="WinEventLog:Security" Eventcode=4624 Logon_Type=2 OR Logon_Type=7 NOT dest_nt_domain="Window Manager" NOT dest_nt_domain="Font Driver Host"
| sort_time 
| convert ctime(_time) as timestamp
| table timestamp,EventCode,Logon_Type,Account_Name,RecordNumber,status
          &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;100&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" field="timestamp"&amp;gt;
          &amp;lt;colorPalette type="expression"&amp;gt;if(tonumber(substr(value,12,2))&amp;amp;gt;=18 OR tonumber(substr(value,12,2))&amp;amp;lt;6, "#FF0000", "#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;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;This is what an XML dashboard looks like. You can see your search in the &amp;lt;search&amp;gt; section and the &amp;lt;format&amp;gt; section is what defines your colours and testing the time range.&lt;/P&gt;&lt;P&gt;That documentation for the format is here&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.0/Viz/TableFormatsXML" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.0/Viz/TableFormatsXML&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 22:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Time-Field-Coloring/m-p/656888#M17310</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-06T22:31:46Z</dc:date>
    </item>
  </channel>
</rss>

