Splunk Search

How to make the URL hyperlink which is in the fields value of the table (Dashboard Studio - JSON format)

SureshkumarD
Explorer

Hi Team,

I have generated dynamic URLs using the lookup and add it in the field value of the table. Now I need to make those dynamic URLs as a hyperlink so that we don't want to manually copy and paste the URL in the browser every time. 

SureshkumarD_0-1716401067750.png

I modified the source code as below, but it is working. Please assist on this. Thank you.

"visualizations": {
        "viz_abc123": {
            "type""splunk.table",
            "options": {
                "count"5000,
                "dataOverlayMode""none",
                "drilldown": {
                    "condition": {
                        "field""URL",
                        "link""$row.URL|n$"
                    }
                },
                "backgroundColor""#FAF9F6",
                "tableFormat": {
                    "rowBackgroundColors""> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByBackgroundColor)",
                    "headerBackgroundColor""> backgroundColor | setColorChannel(tableHeaderBackgroundColorConfig)",
                    "rowColors""> rowBackgroundColors | maxContrast(tableRowColorMaxContrast)",
                    "headerColor""> headerBackgroundColor | maxContrast(tableRowColorMaxContrast)"
                },
                "showInternalFields"false,
                "columnFormat": {
                    "Duration(Secs)": {
                        "data""> table | seriesByName(\"Duration(Secs)\") | formatByType(Duration_Secs_ColumnFormatEditorConfig)",
                        "rowColors""> table | seriesByName(\"Duration(Secs)\") | rangeValue(Duration_Secs_RowColorsEditorConfig)"
                    },
                    "Duration(Mins)": {
                        "data""> table | seriesByName(\"Duration(Mins)\") | formatByType(Duration_Mins_ColumnFormatEditorConfig)",
                        "rowColors""> table | seriesByName(\"Duration(Mins)\") | rangeValue(Duration_Mins_RowColorsEditorConfig)"
                    }
                }
            },
Labels (1)
0 Karma

danspav
SplunkTrust
SplunkTrust

Hi @SureshkumarD,

To get the drilldown working from a field in a table you can use the drilldown options:

"eventHandlers": [
   {
      "type": "drilldown.customUrl",
       "options": {
          "url": "$row.URL.value|n$",
          "newTab": true
      }
   }
]

 

You can set that up in the UI with the following:

danspav_0-1716530100503.png

 

0 Karma

SureshkumarD
Explorer

Hi @danspav ,

I replied on Friday that the hyperlink is not working by providing the source code and screenshots. Could you please look into it and assist? Thank you.

0 Karma

SureshkumarD
Explorer

Hi @danspav ,

I added the event handlers and updated $row.URL.value$ in the link to custom url as per your ask, but still the url is not reflecting as hyperlink. Here is the source code and I shared the screenshot of the table below. Thank you.

 

 "visualizations": {
        "viz_qFxEKJ3l": {
            "type""splunk.table",
            "options": {
                "count"5000,
                "dataOverlayMode""none",
                "drilldown""none",
                "backgroundColor""#FAF9F6",
                "tableFormat": {
                    "rowBackgroundColors""> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByBackgroundColor)",
                    "headerBackgroundColor""> backgroundColor | setColorChannel(tableHeaderBackgroundColorConfig)",
                    "rowColors""> rowBackgroundColors | maxContrast(tableRowColorMaxContrast)",
                    "headerColor""> headerBackgroundColor | maxContrast(tableRowColorMaxContrast)"
                },
                "eventHandlers": [
                    {
                        "type""drilldown.customUrl",
                        "options": {
                            "url""$row.URL.value|n$",
                            "newTab"true
                        }
                    }
                ],
 
 
SureshkumarD_0-1716580237979.png

 

SureshkumarD_1-1716580666781.png

 

0 Karma

danspav
SplunkTrust
SplunkTrust

Hi @SureshkumarD,

I tried out your code - the rows aren't showing up as links because of the table formatting / row color setting.

Remove this line from your code:

    "rowColors": "> rowBackgroundColors | maxContrast(tableRowColorMaxContrast)",

 

That is causing the "link" effect on the clickable rows to disappear.

Here's the full viz code:

"visualizations": {
        "viz_qFxEKJ3l": {
            "type": "splunk.table",
            "options": {
                "count": 5000,
                "dataOverlayMode": "none",
                "drilldown": "none",
                "backgroundColor": "#FAF9F6",
                "tableFormat": {
                    "rowBackgroundColors": "> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByBackgroundColor)",
                    "headerBackgroundColor": "> backgroundColor | setColorChannel(tableHeaderBackgroundColorConfig)",
                    "headerColor": "> headerBackgroundColor | maxContrast(tableRowColorMaxContrast)"
                },
                "eventHandlers": [
                    {
                        "type": "drilldown.customUrl",
                        "options": {
                            "url": "$row.URL.value|n$",
                            "newTab": true
                        }
                    }
                ],

 Give that a go on your dashboard.

0 Karma

SureshkumarD
Explorer

Hi @danspav ,

Thank you for your response. I made the changes and when I clicked on the hyperlink, it is not redirecting to the correct dynamically generated external URL 'https://abc12345.apps.dynatrace.com/ui/apps/dynatrace.classic.distributed.traces/ui/services/SERVICE...'. Here are the screenshots and code below. Please assist on this.

SureshkumarD_0-1717173033019.png

 

SureshkumarD_1-1717175440878.png

 

"visualizations": {
        "viz_aBCd123": {
            "type""splunk.table",
            "options": {
                "count"5000,
                "dataOverlayMode""none",
                "drilldown""none",
                "backgroundColor""#FAF9F6",
                "tableFormat": {
                    "rowBackgroundColors""> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByBackgroundColor)",
                    "headerBackgroundColor""> backgroundColor | setColorChannel(tableHeaderBackgroundColorConfig)",
                    "headerColor""> headerBackgroundColor | maxContrast(tableRowColorMaxContrast)"
                },
                "eventHandlers": [
                    {
                        "type""drilldown.customUrl",
                        "options": {
                            "url""$row.URL.value|n$",
                            "newTab"true
                        }
                    }
                ],
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to February Tech Talks, Office Hours, and Webinars!

💌 Keep the new year’s momentum going with our February lineup of Community Office Hours, Tech Talks, ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Incident Response: Reduce Incident Recurrence with Automated Ticket Creation

Culture extends beyond work experience and coffee roast preferences on software engineering teams. Team ...