Splunk Search

How do I hide a column in a table?

dgomonov
New Member

Imagine a scenario where I need to have a hidden column in my table to serve a passing functionality.

Example:

  1. I create a second column (let’s call it XYZ) with the appropriate whichever text (using replace, lower, etc) to be passed into URLs with $click.XYZ$
  2. I can use now 'condition.. ' inside of 'drill down' to specify that I actually want my first column ABC to be clickable ('field=ABC') and serve the passing functionality.
  3. How do I hide now second XYZ column? - Please be specific code wise how to do it

Thanks!

0 Karma

jpolvino
Builder

Just to make sure I understand, you have a dashboard panel with a stats table. The table has columns fieldA, fieldB, fieldC, fieldD and you want to use the value in fieldC, but not display that column in the stats table. This might be for a key you don't want to display, but use as part of a drilldown.

One way to do it:

  <table>
    <title>Your title here</title>
    <search>
      <query> (your search here) | table fieldA fieldB fieldC fieldD </query>
      <earliest>-1d@d</earliest>
      <latest>now</latest>
    </search>
    <option name="count">10</option>
    <option name="drilldown">row</option>
    <option name="rowNumbers">false</option>
    <fields>fieldA,fieldB,fieldD</fields>
    <drilldown>
      <set token="clientTok">$row.fieldC$</set>
      <set token="forms.clientTok">$row.fieldC$</set>
    </drilldown>
  </table>

The query should output all the fields you want to display, plus the one you want to hide. I just used table as an example, but you likely already have them listed by stats or something similar. The fields section controls fields that you want to see in the panel. The token clientTok can then be used in other panels, such as the target panel, using the $clientTok$.

Amiel_
Engager

Work perfectly !

0 Karma

hijacob
Communicator

Hi,

try this command...
| fields 'list of fields you want to be displayed'

Greetings,

Jacob

0 Karma

hijacob
Communicator

besides you can try
|fields - XYZ column

rdownie
Communicator

or
.... | fields - 'list of fields you want to exclude'

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...