Dashboards & Visualizations

Html Panel form: How to create a table with two columns with the right column having dynamic value?

Deepz2612
Explorer

Hi,

My requirement is to:
Create a table with two columns with left column having static data and right having dynamic value
The right dynamic value - meaning I wanted to see only the result of a Splunk query.

I used the follow code but unable to achieve it.

 <row>
    <panel>
      <title>Sample Template</title>
      <html>
        <table border="1" width="1000" padding="10px">
          <th>
            <tr>
              <th width="200" align="left">Impacted time window(in EST)</th>
              <th width="800" align="left">
                <panel>
                  strptime($search_earliest$, "%Y-%m-%d %H:%M:%S.%3N") to strptime($cmd_time.latest$, "%Y-%m-%d %H:%M:%S.%3N")

                </panel>

                </th>
            </tr>
            <tr>
              <th width="200" align="left">Success rate(Total and Regionwise) during Impact Window </th>
              <th width="800" align="left">
                <row>
                <panel>$country$</panel>
                </row>
                </th>
            </tr>
            <tr>
              <th width="200" align="left">Impact to Customer</th>
              <th width="800" align="left">Row - 3 - 2nd column</th>
            </tr>
            <tr>
              <th width="200" align="left">Error code(incase of IOT)</th>
              <th width="800" align="left">Row - 2 2nd column</th>
            </tr>
            <tr>
              <th width="200" align="left">Analysis</th>
              <th width="800" align="left">Enter your analysis details</th>
            </tr>
            <tr>
              <th width="200" align="left">Action taken</th>
              <th width="800" align="left">SMS delay has been added in Canada RTS ticket</th>
            </tr>
            <tr>
              <th width="200" align="left">Next Steps</th>
              <th width="800" align="left">will continue to monitor for next 1 hour</th>
            </tr>
            <tr>
              <th width="200" align="left">Advisory</th>
              <th width="800" align="left"> N/A </th>
            </tr>
            <tr>
              <th width="200" align="left">L1POE bridge opened(Yes/No)</th>
              <th width="800" align="left">Row - 3 - 2nd column</th>
            </tr>
            <tr>
              <th width="200" align="left">L1POE bridge detail</th>
              <th width="800" align="left">Row - 2 2nd column</th>
            </tr>

          </th>
        </table>
      </html>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        <div align="right">
          <b>Dashboard Version 3.7</b>
        </div>
      </html>
    </panel>
  </row>
</form>

In the above - if you could see,my out is not displaying the time for Impacted time window(in EST) instead it is displaying the entire string I have given ( strptime($search_earliest$, "%Y-%m-%d %H:%M:%S.%3N") to strptime($cmd_time.latest$, "%Y-%m-%d %H:%M:%S.%3N")).

Kindly help me with it.

Note : I do not have permissions and access to use Splunk dashboard app.

Tags (2)
0 Karma

niketn
Legend

@Deepz2612 you can use JS to convert search result data to html table as per your need. Refer to my older answer:

https://answers.splunk.com/answers/662523/how-to-show-table-result-in-one-page-table-modific.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

Deepz2612
Explorer

Thanks..
But my requirement is to put in a tabular format.

In the above code that i have share,whatever search query that i give is getting printed as as table value rather than printing the result of the query.

Could you kindly help

0 Karma

Deepz2612
Explorer

Hi,

Could you kindly help please

0 Karma
Get Updates on the Splunk Community!

Demo Day: Strengthen Your SOC with Splunk Enterprise Security 8.1

Today’s threat landscape is more complex than ever. Security operation centers (SOCs) are overwhelmed with ...

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...