How To Freeze The First Column  In A Table Of A Dashboard Panel

How To Freeze The First Column  In A Table Of A Dashboard Panel

We all know how to create dashboards in Splunk and also some techniques to modify the dashboard panels.

Today we will show you another trick to modify the dashboard panel. Today we will show you How To Freeze The First Column  In A Table Of A Dashboard Panel.

Step:1

First, create a dashboard panel with the below query,

index=_internal sourcetype=splunkd_ui_access 
| table method,bytes,status,date_minute,date_second,date_year,clienIp,host,req_time,uri,user,sourcetype,source,uri_path,uri_query,spent,file

We have put this query in one Dashboard. freeze1

You can see the first column I.e. “method”. freeze2

Now, if I will scroll the mouse from left to write, we are not see the first column that is “method”It will be very difficult to understand that  the other column-values  are regarding which host. But, if we can freeze the  method column , it will be easier to understand that the other column values are regarding which method. To achieve this we have to modify the source code of the dashboard.

Step:2 Now, go to the Edit option in Dashboard page and then click on  Source , where we have to make the changes. freeze3 freeze4

Step:3

For this, we have to make some changes  in the source code as follows, freeze6(1)

Inside the <panel> tag we have to open <html> tag and inside that we have to open <style> tag.

Inside <style> tag we have to write the below custom CSS,

#tableOne div [data-view="views/shared/results_table/ResultsTableMaster"] td:nth-child(1) {
                position: fixed;
                }

freeze6(2) Here, for fixing the first column we have used “td:nth-child(1) { position:fixed; }”

Which column you want to fix according to that you can give the value of “n” for “td:nth-child(n)”,that column will be fixed[n should be an integer value].

In which table you want to apply this custom CSS you have to create table id for that as below,

<table id=”tableOne”>

You can see that this id is used in that custom CSS [See ABOVE]

Now, see the difference. We  scroll the mouse from left to wright, we can see the first column(method) values as static. freeze7

Hope this will help you in achieving the below requirement without fail:

How To Freeze The First Column  In A Table Of A Dashboard Panel

Happy Splunking!!

Advertisements

One comment

  1. can you guys post, something related to rest API’s.. how we can use rest to post saved search data from one splunk environment to another?
    or using alert actions?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.