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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...