Splunk Enterprise

Need to center align the table values in Dashboard studio

Viral_G
Observer

Hi,

I have my Splunk Dashboard created in Dashboard studio. The dashboard has 3 tables and all the values in this tables are either Left or Right aligned but I want them to be Center aligned.

I tried finding solutions, but all the solutions mentioned in other posts are for the Classic dashboards which are written in XML.

How can we do this in JSON written Dashboard.

Thanks,
Viral

Labels (2)
0 Karma

KendallW
Contributor

Hi @Viral_G,

Try adding "align": "center" in the columnFormat tag of your tables, e.g.

"columnFormat": {
  "identity": {
    "data": "> table | seriesByName(\"identity\") | formatByType(identityColumnFormatEditorConfig)",
    "align": "center"
  },
  "usernames": {
    "data": "> table | seriesByName(\"usernames\") | formatByType(usernamesColumnFormatEditorConfig)",
    "align": "center"
  }
}

 

0 Karma

Viral_G
Observer

Hi @KendallW,

I tried as you suggested but still it doesn't seem to work.

Below is a part of my Dashboard code:

"viz_myN1qvY3": {
            "type": "splunk.table",
            "dataSources": {
                "primary": "ds_Ir18jYj7"
            },
            "title": "Availability By Market",
            "options": {
                "backgroundColor": "transparent",
                "tableFormat": {
                    "rowBackgroundColors": "> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByBackgroundColor)",
                    "headerBackgroundColor": "> backgroundColor | setColorChannel(tableHeaderBackgroundColorConfig)",
                    "rowColors": "> rowBackgroundColors | maxContrast(tableRowColorMaxContrast)",
                    "headerColor": "> headerBackgroundColor | maxContrast(tableRowColorMaxContrast)"
                },
                "headerVisibility": "fixed",
                "fontSize": "small",
                "columnFormat": {
                    "Availability": {
                        "data": "> table | seriesByName(\"Availability\") | formatByType(AvailabilityColumnFormatEditorConfig)",
                        "rowColors": "> table | seriesByName('Availability') | pick(AvailabilityRowColorsEditorConfig)",
                        "rowBackgroundColors": "> table | seriesByName(\"Availability\") | rangeValue(AvailabilityRowBackgroundColorsEditorConfig)",
                        "align": "center"
                    }
                }
            },
            "context": {
                "AvailabilityColumnFormatEditorConfig": {
                    "number": {
                        "thousandSeparated": false,
                        "unitPosition": "after",
                        "precision": 2
                    }
                }

The Availability column still has values aligned to right.Availability.PNG

 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...