Hello There,
Been trying to get the simple task of removing a stats table using CSS. I need the data in the table, but I dont want the format of the table. I would like a white background with just my data, no rows on the table or columns. I have tried the code below, but it takes no effect on my table. Any suggestions?
#removeTable . table, th, td {
border: 0px solid black;
}
</style>
</html>
<table id="removeTable">
Can you please try this CSS?
#removeTable .table th {
background: #ffffff !important;
}
#removeTable .table th a{
color: black !important;
font-weight: bold !important;
}
#removeTable table tr.odd td{
background: #ffffff !important;
}
#removeTable table tr.even td{
background: #ffffff !important;
}
#removeTable table tr td{
color: #000 !important;
}
Can you please try this CSS?
#removeTable .table th {
background: #ffffff !important;
}
#removeTable .table th a{
color: black !important;
font-weight: bold !important;
}
#removeTable table tr.odd td{
background: #ffffff !important;
}
#removeTable table tr.even td{
background: #ffffff !important;
}
#removeTable table tr td{
color: #000 !important;
}
Thanks @kamlesh_vaghela I don't see the table anymore using CSS you have provided - which is what I wanted. I appreciate all your help.
If you don't wanna table but need search results then you just keep search outside table ad remove table.
Can you please try this?
<dashboard>
<label>Only Search</label>
<search>
<query>| makeresults | eval data1="Hi", data2="Hello"</query>
<done>
<set token="tkn_data1">$result.data1$</set>
<set token="tkn_data2">$result.data2$</set>
</done>
</search>
<row>
<panel>
<html>
<h1>Use below token in any search or label</h1>
tkn_data1 : $tkn_data1$ <br />
tkn_data2: $tkn_data2$
</html>
</panel>
</row>
</dashboard>
I hope this will you.
Thanks
KV
▄︻̷̿┻̿═━一
If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.
@kamlesh_vaghela Thanks, this hides my table, but I still cant get my query to display. Where should the tokens below go? I put them in my query search after | search, but still no results. Below is also my query
$tkn_data1$
$tkn_data2$
My query:
<dashboard>
<label>Only Search</label>
<search>
<query>| rest /servicesNS/-/-/data/lookup-table-files search="*_Report.csv"
| eval updated=strptime(updated,"%FT%T%:z")
| eval desired_time=strftime(updated, "%B %d, %Y")
| rename desired_time as "Last Updated" title as Team
| search $tkn_data1$ $tkn_data2$
| table "Last Updated", Team
</query>
<done>
<set token="tkn_data1">$result.data1$</set>
<set token="tkn_data2">$result.data2$</set>
</done>
</search>
<row>
<panel>
<html>
<h1>Use below token in any search or label</h1>
tkn_data1 : $tkn_data1$ <br />
tkn_data2: $tkn_data2$
</html>
</panel>
</row>
</dashboard>
If you want the data, but no table, does not just making the panel dependant not work, i.e.
<table depends="$non_existant_token$">
when you say you 'need the data', do you mean visually or to facilitate some drilldown or other functionality in the dashboard?
I need the data to support other functionality in the dashboard. The data is on a stats table and it’s running a | rest command that shows when look ups were last updated date wise, but since that table is occupying too much room- I have managed to reduce the table width.
At this time I just need to remove the table rows - the coloring and just have a white background, but keep the data is this possible using CSS?
You can hide the table totally with the depends=xx syntax I describe, but the search will still run and if you have a <done> clause as part of your table to set tokens.
How are you using that table data?
Hi @bowesmana
I'm not a developer and new to Splunk, so this is tricky for me. Below is my code:
<table depends="$non_existant_token$">
<search>
<query>| rest /servicesNS/-/-/data/lookup-table-files search="*_Report.csv"
| eval updated=strptime(updated,"%FT%T%:z")
| eval desired_time=strftime(updated, "%B %d, %Y")
| rename desired_time as "Last Updated" title as Team
| table "Last Updated", Team
<done>
<set token="tkn_data1">$result.data1$</set>
<set token="tkn_data2">$result.data2$</set>
OK, so the concept of <done> is that you are creating an event handler that is triggered when the search completes
the set token statements will set tokens based on the FIRST ROW of your result table, so the answer from @kamlesh_vaghela is showing you how to get the fields from your result, but in your example you would need something like this
<table depends="$non_existant_token$">
<search>
<query
| rest /servicesNS/-/-/data/lookup-table-files search="*_Report.csv"
| eval updated=strptime(updated,"%FT%T%:z")
| eval desired_time=strftime(updated, "%B %d, %Y")
| rename desired_time as last_updated title as Team
| table last_updated, Team
</query>
</search>
<done>
<set token="token_last_updated">$result.last_updated$</set>
<set token="token_team">$result.Team$</set>
</done>
<any other options for the table here>
</table>
However, this is ONLY useful to get the first row of the results from your rest call. Hence my question about how you want to use the data. That's the question that needs answering.
For example, what are you intending to do with this data and if you have multiple rows, how do you want to use it?
Useful docs are
https://docs.splunk.com/Documentation/Splunk/8.1.4/Viz/PanelreferenceforSimplifiedXML
https://docs.splunk.com/Documentation/Splunk/8.2.0/Viz/tokens
https://docs.splunk.com/Documentation/Splunk/8.2.0/Viz/EventHandlerReference
@bowesmana Thanks for your help, going to review the docs you sent to help me understand.