Splunk Search

How can you change the width of a column in a table(HTML) or add a new line break to a field?

kdimaria
Communicator

Hello! So I am running into a problem where my table visualization looks weird because one of my columns is too long. The column that is too long is grabbing from a csv lookup file and I was trying to add a new line break in the csv file and doing the lookup in Splunk but it doesn't take in the new line break. So, I was wondering if there is a way to set that columns size on the table so the field will auto line break or if theres a way to change the field to have the line break or how to do it with the csv lookup file. thanks

gcusello
SplunkTrust
SplunkTrust

Hi kdimaria,
I know that you don't want css or javascripts but the easiest way is css and in the Splunk 7.x Dashboard Examples you can find an useful example to do this.
In this app you can find also a way to change panels width using a javascript.

It's also possible to insert in a dashboard some html tags to modify a panel, but anyway you use a css element in a Splunk dashboard: e.g. I have four Single Values in a panel and I want to be sure that they are two for each row, to do this you can insert between panel tags

  <html>
     <style type="text/css">
        .single {
   width: 50% !important;
          }
  </style>
 </html>

Anyway you're using css elements.

Bye.
Giuseppe

0 Karma

kdimaria
Communicator

Isn't this XML? my whole dashboard is now in HTML and I do all the modifications in HTML. Is there a way to use Javascript to change the column sizes?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi kdimaria,
Usually Splunk dashboards are in XML, but in the above way it's possible to insert in XML a css element without modifying css.

Using Javascripts, it's possible to modify panels width not column width, to modify column width the only way is css.
Bye.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...