Splunk Search

How to add hyperlink in specific text?

katrinamara
Path Finder

I want to have a hyperlink in my Title text but not all the text in the title will be clickable, the only clickable is the Date. And when I click it will show a small calendar pick so I can choose specific date. Is it possible? The default date is the current date. See below screenshot and code.

alt text

  <input type="link" token="timetok">
            <label>timeNow</label>
            <fieldForLabel>Choose</fieldForLabel>
            <fieldForValue>Choose</fieldForValue>
            <search>
              <query>|makeresults 
    | eval Choose=strftime(now()," %b %d, %Y") 
    | eval choose=strptime(Choose," %b %d, %Y")
    | table Choose choose</query>
              <done>
                <set token="timetok">$result.Choose$</set>
                <set token="timetok1">$result.choose$</set>
              </done>
            </search>
          </input>

     <row>
        <panel>
          <title>Out of Office Summary for $timetok$</title>

          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$"
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between

    | where Leave_Type = "Vacation Leave"
    | dedup EID,Leave_Type,Leave_Start_Date,Status 
    | stats count as Total</query>
              <earliest>0</earliest>
              <latest></latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0xf2b827","0xf2b827"]</option>
            <option name="rangeValues">[0]</option>
            <option name="underLabel">on Vacation</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.vl_tok$=&quot;0&quot;">
                <set token="form.vl_tok">1</set>
                <set token="form.sl_tok">0</set>
                <set token="form.tr_tok">0</set>
                <set token="form.ape_tok">0</set>
                <set token="form.el_tok">0</set>
                <set token="form.eh_tok">0</set>
                <set token="vacation_drilldown">$click.value$</set>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
              <condition match="$form.vl_tok$=&quot;1&quot;">
                <set token="form.vl_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$" 
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between
    | where Leave_Type = "Sick Leave"
    | stats count as Total</query>
              <earliest>0</earliest>
              <latest></latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0xd6563c","0xd6563c"]</option>
            <option name="rangeValues">[1]</option>
            <option name="underLabel">on Sick</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.sl_tok$=&quot;0&quot;">
                <set token="form.sl_tok">1</set>
                <set token="form.vl_tok">0</set>
                <set token="form.tr_tok">0</set>
                <set token="form.ape_tok">0</set>
                <set token="form.el_tok">0</set>
                <set token="form.eh_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <set token="sick_drilldown">$click.value$</set>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
              <condition match="$form.sl_tok$=&quot;1&quot;">
                <set token="form.sl_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$" 
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between

    |dedup EID,Leave_Type,Leave_Start_Date,Status 
    | where Leave_Type = "Training"
    | stats count as Total</query>
              <earliest>$earliest$</earliest>
              <latest>$latest$</latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0x91af27","0x91af27"]</option>
            <option name="rangeValues">[1]</option>
            <option name="underLabel">on Training</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.tr_tok$=&quot;0&quot;">
                <set token="form.tr_tok">1</set>
                <set token="form.sl_tok">0</set>
                <set token="form.vl_tok">0</set>
                <set token="form.ape_tok">0</set>
                <set token="form.el_tok">0</set>
                <set token="form.eh_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <set token="training_drilldown">$click.value$</set>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
              <condition match="$form.tr_tok$=&quot;1&quot;">
                <set token="form.tr_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$" 
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between

    | where Leave_Type = "APE"
    |dedup EID,Leave_Type,Leave_Start_Date,Status 
    | stats count as Total</query>
              <earliest>$earliest$</earliest>
              <latest>$latest$</latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0x3863a0","0x3863a0"]</option>
            <option name="rangeValues">[1]</option>
            <option name="underLabel">on APE</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.ape_tok$=&quot;0&quot;">
                <set token="form.tr_tok">0</set>
                <set token="form.sl_tok">0</set>
                <set token="form.vl_tok">0</set>
                <set token="form.ape_tok">1</set>
                <set token="form.el_tok">0</set>
                <set token="form.eh_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <set token="ape_drilldown">$click.value$</set>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
              <condition match="$form.ape_tok$=&quot;1&quot;">
                <set token="form.ape_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$" 
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between

    |dedup EID,Leave_Type,Leave_Start_Date,Status 
    | where Leave_Type = "Emergency Leave"
    | stats count as Total</query>
              <earliest>$earliest$</earliest>
              <latest>$latest$</latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0xed8440","0xed8440"]</option>
            <option name="rangeValues">[1]</option>
            <option name="underLabel">on Emergency Leave</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.el_tok$=&quot;0&quot;">
                <set token="form.tr_tok">0</set>
                <set token="form.sl_tok">0</set>
                <set token="form.vl_tok">0</set>
                <set token="form.ape_tok">0</set>
                <set token="form.el_tok">1</set>
                <set token="form.eh_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <set token="emergency_drilldown">$click.value$</set>
              </condition>
              <condition match="$form.el_tok$=&quot;1&quot;">
                <set token="form.el_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
          <single>
            <search>
              <query>|inputcsv acn_pmo_ooo_save_search_calendar
    |eval Calendar_Date = "$timetok1$" 
    |eval timetrial=strftime(now(),"%m/%d/%Y"), timetrial=strptime(timetrial,"%m/%d/%Y")
    |eval Choose = if(Calendar_Date=="*.000000",timetrial,Calendar_Date)
    |where Choose=between

    |dedup EID,Leave_Type,Leave_Start_Date,Status 
    | where Leave_Type = "Elective Holiday"
    | stats count as Total</query>
              <earliest>$earliest$</earliest>
              <latest>$latest$</latest>
            </search>
            <option name="colorMode">block</option>
            <option name="drilldown">all</option>
            <option name="height">87</option>
            <option name="link.visible">0</option>
            <option name="rangeColors">["0x5f7396","0x5f7396"]</option>
            <option name="rangeValues">[1]</option>
            <option name="underLabel">on Elective Holiday</option>
            <option name="useColors">1</option>
            <drilldown>
              <condition match="$form.eh_tok$=&quot;0&quot;">
                <set token="form.tr_tok">0</set>
                <set token="form.sl_tok">0</set>
                <set token="form.vl_tok">0</set>
                <set token="form.ape_tok">0</set>
                <set token="form.el_tok">0</set>
                <set token="form.eh_tok">1</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <set token="elective_drilldown">$click.value$</set>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
              <condition match="$form.eh_tok$=&quot;1&quot;">
                <set token="form.eh_tok">0</set>
                <unset token="vacation_drilldown">$click.value$</unset>
                <unset token="training_drilldown">$click.value$</unset>
                <unset token="sick_drilldown">$click.value$</unset>
                <unset token="ape_drilldown">$click.value$</unset>
                <unset token="elective_drilldown">$click.value$</unset>
                <unset token="emergency_drilldown">$click.value$</unset>
              </condition>
            </drilldown>
          </single>
        </panel>
      </row>
0 Karma

mdsnmss
SplunkTrust
SplunkTrust

Try replacing the title with the HTLM tags and using that. Something like this:

<html><h3>Out of Office Summary for <a href="your link">$timetok$</a></h3></html>

You can change the size of the title by adjusting your header attributes. H1 is bigger and gets smaller as you go higher.

0 Karma

mdsnmss
SplunkTrust
SplunkTrust

I actually just saw the calendar pick part of the question. That more seems like an input option rather than hyperlink. That is a bit more complex. I'll see if I can come up with something for that.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...