Dashboards & Visualizations

Need help adding token to my custom drilldown

jcorkey
Explorer

Below is my search on my dashboard:

| multisearch [search index=* host=* sourcetype="*" user="*" "type=ADD_USER" | eval rectype1="Created new user"] [search index=* host=* sourcetype="*" "usermod" AND "type=USER_MGMT" | eval rectype2="Added new user to group"] [search host="*" index="secure_logs" sourcetype=linux_secure  "su:" "session opened for user" | eval Date=strftime(_time, "%Y/%m/%d") | rex "by (?<user>[^(]+)" | rex "^[^\)\n]*\):\s+\w+\s+\w+\s+\w+\s+\w+\s+(?P<userOfInterest>\w+)" | eval rectype3= "Switched to different user account"] | stats dc(rectype3) as "Switched to different user account" , dc(rectype2) as "Added new user to group", dc(rectype1) as "Created new user" by user

Below is my drilldown:

<drilldown>
  <condition field="Switched to different user account">
    <set token="user">$click.value2$</set>
    <link target="_blank">search?q=host="*" index="*" user=$user$ sourcetype=linux_secure  "su:" "session opened for user" | rex "by (%3F&lt;user&gt;[^(]%2b)" | rex "^[^\)\n]*\):\s%2b\w%2b\s%2b\w%2b\s%2b\w%2b\s%2b\w%2b\s%2b(%3FP&lt;userOfInterest&gt;\w%2b)" | table _time, userOfInterest, user | rename userOfInterest as "User", user as "Switched to user"&amp;earliest=-4h@h&amp;latest=now</link>
  </condition>
  <condition field="Added new user to group">
    <set token="user">$click.value2$</set>
    <link target="_blank">search?q=index=* host=* sourcetype="*" user=$user$ "usermod" OR "visudo" AND "type=USER_MGMT" add-user-to-shadow-group | table _time, user, acct, grp | rename acct as "Newly created user", grp as "Added to group"&amp;earliest=-4h@h&amp;latest=now</link>
  </condition>
  <condition field="Created new user">
    <set token="user">$click.value2$</set>
    <link target="_blank">search?q=index=* host=* sourcetype="*" user=$user$ useradd  "type=ADD_USER" | rex "^[^=\n]*=(%3FP&lt;userOfInterest&gt;\w )" | table user, id | rename id as "Added user's id"&amp;earliest=-4h@h&amp;latest=now</link>
  </condition>
  <condition>
    <!-- Optional No Drilldown from other columns-->
  </condition>
</drilldown>

Right now the <set token="user">$click.value2$</set> in my drilldown grabs the values of the rectype in my search on click. I really need it to grab the value of the user which is how the stats chart is been listed "by user" at the end of my search string. I want to have the value instead of the rectype values that is gets when I click.

How can I accomplish this?

0 Karma
1 Solution

cmerriman
Super Champion

try $row.user$ instead of $click.value2$ this should give you user for any value clicked on in the row.

http://docs.splunk.com/Documentation/Splunk/6.6.2/Viz/PanelreferenceforSimplifiedXML#event_2

View solution in original post

0 Karma

cmerriman
Super Champion

try $row.user$ instead of $click.value2$ this should give you user for any value clicked on in the row.

http://docs.splunk.com/Documentation/Splunk/6.6.2/Viz/PanelreferenceforSimplifiedXML#event_2

0 Karma

jcorkey
Explorer

I have found the answer...Just had to use click.value instead of click.value2

0 Karma

woodcock
Esteemed Legend

Don't forget to upvote any helpful answers and either submit your own to Accept or Accept the one that really contained the heart of the answer, so that the question is closed.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...