Splunk Search

HELP FOR FORMATTING TEXT IN A PANEL SEARCH

jip31
Motivator

Hello

I have the panel below in my dashboard

<row>
    <panel>
      <single>
        <search>
          <query>| inputlookup host.csv 
| stats count 
| eval count = if(count == 0, "no host", "Perimeter : " + tostring(count) + " hosts")</query>
          <earliest>-30d@d</earliest>
          <latest>now</latest>
        </search>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x65a637","0xd93f3c","0xd93f3c"]</option>
        <option name="rangeValues">[0,1]</option>
        <option name="refresh.display">progressbar</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>

I need to format (font size, font weight, background color) the count result
I added and

tags after tags and added the style between

Tags (1)
0 Karma
1 Solution

vnravikumar
Champion

Hi

Try this and modify accordingly

<dashboard>
  <label>singleBG</label>
  <row>
    <panel>
      <html>
         <style>
          #test rect{
           fill: red !important;
           }

           #test .single-result{

           font-size: 15px !important;
           font-weight: normal !important;
           font-style: italic;
           }
         </style>
       </html>
      <single id="test">
        <search>
          <query>index="_internal" |stats count | eval count = if(count == 0, "no host", "Perimeter : " + tostring(count) + " hosts")</query>
          <earliest>-30d@d</earliest>
          <latest>now</latest>
        </search>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x65a637","0xd93f3c","0xd93f3c"]</option>
        <option name="rangeValues">[0,1]</option>
        <option name="refresh.display">progressbar</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Try this and modify accordingly

<dashboard>
  <label>singleBG</label>
  <row>
    <panel>
      <html>
         <style>
          #test rect{
           fill: red !important;
           }

           #test .single-result{

           font-size: 15px !important;
           font-weight: normal !important;
           font-style: italic;
           }
         </style>
       </html>
      <single id="test">
        <search>
          <query>index="_internal" |stats count | eval count = if(count == 0, "no host", "Perimeter : " + tostring(count) + " hosts")</query>
          <earliest>-30d@d</earliest>
          <latest>now</latest>
        </search>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x65a637","0xd93f3c","0xd93f3c"]</option>
        <option name="rangeValues">[0,1]</option>
        <option name="refresh.display">progressbar</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>
</dashboard>
0 Karma

jip31
Motivator

its perfect thanks

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...