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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...