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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...