Dashboards & Visualizations

How to create a hyperlink from the column values in a table?

aditsss
Motivator

Hi Everyone,

 

I have one requirement.  I have one table Dashboard which consists of multiple Columns.

There is one column "url". I want it to be hyperlink so that it can open.

Below is my code:

<row>
<panel>
<table>
<search>
<query>index=abc sourcetype=xyz source="ser.log" $process_tok1$
| rex field=_raw "(?&lt;id&gt;[A_Za-z0-9]{8}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{12})"
| join type=outer id [inputlookup nifi_api_parent_chains_e1.csv]|search $ckey$|search $usr$
| table _time _raw host id parent_chain url
</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="refresh.display">progressbar</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
</panel>
</row>

I want url column should be a hyperlink . How can I do that.

Thanks in advance.

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
<link target="_blank">$row.url|n$</link>

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Use a drilldown which opens a page based on the value of the cell. You could even change the text so that it looks like a link e.g. underlined and blue.

0 Karma

aditsss
Motivator

@ITWhisperer 

I have made the below changes but its not working.

Can you guide me where I have gone wrong:

<panel>
<table>
<search>
<query>index=abc sourcetype=xyz source="user.log" $process_tok1$
| rex field=_raw "(?&lt;id&gt;[A_Za-z0-9]{8}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{12})"
| join type=outer id [inputlookup nifi_api_parent_chains_e1.csv]|search $ckey$|search $usr$|eval ClickHere= url
| table _time _raw host id parent_chain url
</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="refresh.display">progressbar</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
<drilldown>
<condition field="url">
<link target="_blank">$url$</link>
</condition>
</drilldown>
</table>
</panel>

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
<link target="_blank">$row.url|n$</link>

vamsi354
Explorer

@ITWhisperer this really helped is there a way to show only url column results in blue remaining 4 fields in just text (i.e Black) color 

vamsi354_0-1660851182934.png

i want something like below

vamsi354_1-1660851286119.png

 

<row>
<panel>
<table>
<search>
<query>|inputlookup testing.csv | eval ClickHere= url
| table _time duration_seconds dv_assignment_group dv_number dv_u_substate url
</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
<format type="number" field="dv_u_substate"></format>
<drilldown>
<condition field="url">
<link target="_blank">$row.url|n$</link>
</condition>
<condition field="*"></condition>
</drilldown>
</table>
</panel>
</row>

0 Karma

aditsss
Motivator

@ITWhisperer 

 

Thank u so much 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...