Getting Data In

If passing a parameter from main dashboard to next view, how to show this parameter as read only in the label or input type field?

vishal_bandavad
Explorer

I am passing a parameter from main dashboard to next view. I want to show that parameter to the user in the label or input type field. If i use Input type="text" , it becomes editable. I want to make this field read only. i have used readonly="readonly" in, but it's not working . please help.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Have this setup in your search app.

dashboard1.xml

<dashboard>
  <label>Dashboard1</label>
  <row>
    <panel>     
     <table>            
<searchString>
        index=_internal | stats count by sourcetype
      </searchString>
      <earliestTime>-60m</earliestTime>
      <latestTime>now</latestTime>
            <drilldown target="My New Window">
           <link>
              /app/search/dashboard2?sourcetype=$row.sourcetype$
            </link>
          </drilldown>
          </table>
        </panel>
      </row>
    </dashboard>

dashboard2.xml

 <dashboard>
  <label>Dashboard2</label>  
  <row>
    <panel>
      <html>
       <h1>$sourcetype$</h1>
      </html>
      <table>
        <search>
          <query>index=_internal sourcetype=$sourcetype$ | stats count</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="wrap">undefined</option>
        <option name="rowNumbers">undefined</option>
        <option name="drilldown">row</option>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma

SirHill17
Communicator

Is that solution to pass the paramater from dashboard1 to dashboard2 works ?

I tried but dashboard2 is not able to get the value.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Add an html element in your dashboard to show read-only content. E.g.

    <form>
  <label>Form name</label>
  <fieldset submitButton="false" autoRun="true">
    <input ..........">
      .........
    </input>
     .........
     ......
    <html>
      <h1>$msgCode$</h1>
    </html>

vishal_bandavad
Explorer

Thanks Soni,
But you need to define a token in tag to show the parameter. so by default it shows input type box. which is editable.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...