All Apps and Add-ons

Cell drilldown always sets value of first column

shaunm001
Path Finder

I have the following dashboard table:

      <table>
        <title>messageIdTok=$messageIdTok$ userIdTok=$userIdTok$ subjectTok=$subjectTok$</title>
        <search base="baseSearch">
          <query>| search subject="*$subjectTok$*" UserId="$userIdTok$" ipAddress="$ipAddressTok$" messageId="$messageIdTok$" | table _time,UserId,subject,Operation,messageId,ClientInfoString,ipAddress</query>
        </search>
        <option name="count">10</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <drilldown>
          <condition field="subject">
            <set token="subjectTok">$row.subject$</set>
            <set token="messageIdTok">*</set>
            <set token="userIdTok">*</set>
            <set token="ipAddressTok">*</set>
          </condition>
          <condition field="messageId">
            <set token="messageIdTok">$click.value$</set>
            <set token="subjectTok">*</set>
            <set token="userIdTok">*</set>
            <set token="ipAddressTok">*</set>
          </condition>
          <condition field="UserId">
            <set token="messageIdTok">*</set>
            <set token="subjectTok">*</set>
            <set token="userIdTok">$row.UserId$</set>
            <set token="ipAddressTok">*</set>
          </condition>
        </drilldown>
      </table>

In the "messageId" drilldown condition, i'm using $click.value$. But when I do this, clicking the cell always sets the messageIdTok to the value in the first column (_time in this case). I also notice that when i have table option "drilldown" set to "cell", moving the mouse over the table always highlights the cell I'm hovering over as well as the first cell of that row (video here). 

Any suggestions on how to correct this behavior?

Labels (1)
0 Karma
1 Solution

shaunm001
Path Finder

Nevermind....looks like using $click.value2$ solves the problem. 

View solution in original post

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @shaunm001 

Edit - you beat me to it 🙂 Seems you've got it sorted anyway.

You need to use $click.value2$ instead. I've included an example below to test this. It doesnt seem well documented but a few of the docs do reference click.value2 - it seems to suggest click.value sets the "X-axis value" which it presumably infers as _time.

<form version="1.1" theme="dark">
  <label>Search and Filter Dashboard (Makeresults Base)</label>
  <description>A dashboard to search and filter generated logs with drilldown capabilities.</description>
  <!-- Define default token values -->
  <!-- Define the base search using makeresults -->
  <search id="baseSearch">
    <query>
      | makeresults count=15
      | eval _time = now() - round(random() * 86400)
      | streamstats count as rec_num
      | eval UserId = case(
          rec_num % 3 == 0, "user_A",
          rec_num % 3 == 1, "user_B",
          rec_num % 3 == 2, "user_C"
        )
      | eval subject = case(
          rec_num % 5 == 0, "Email sent successfully",
          rec_num % 5 == 1, "Login attempt failed",
          rec_num % 5 == 2, "Report generated",
          rec_num % 5 == 3, "File upload complete",
          rec_num % 5 == 4, "System error detected"
        )
      | eval Operation = case(
          rec_num % 4 == 0, "LOGIN",
          rec_num % 4 == 1, "EMAIL",
          rec_num % 4 == 2, "UPLOAD",
          rec_num % 4 == 3, "REPORT"
        )
      | eval messageId = "msg-" . rec_num . "-" . substr(md5(_time), 1, 8)
      | eval ClientInfoString = "{\"os\":\"Windows\",\"browser\":\"Chrome\",\"ipAddress\":\"192.168.1.10" . (rec_num % 5) . "\"}"
      | eval _raw = json("{\"os\":\"Windows\",\"browser\":\"Chrome\",\"ipAddress\":\"192.168.1.10" . (rec_num % 5) . "\"}")
      | spath
      | fields _time, UserId, subject, Operation, messageId, ClientInfoString, ipAddress
    </query>
    <earliest>-24h@h</earliest>
    <latest>now</latest>
  </search>
  <fieldset submitButton="true">
    <input type="text" token="messageIdTok">
      <label>Message ID:</label>
      <default>*</default>
      <initialValue>*</initialValue>
    </input>
    <input type="text" token="userIdTok">
      <label>User ID:</label>
      <default>*</default>
      <initialValue>*</initialValue>
    </input>
    <input type="text" token="subjectTok">
      <label>Subject Contains:</label>
      <default>*</default>
      <initialValue>*</initialValue>
    </input>
    <input type="text" token="ipAddressTok">
      <label>IP Address:</label>
      <default>*</default>
      <initialValue>*</initialValue>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>messageIdTok=$messageIdTok$ userIdTok=$userIdTok$ subjectTok=$subjectTok$ ipAddressTok=$ipAddressTok$</title>
        <search base="baseSearch">
          <query>
            | search subject="*$subjectTok$*"
            UserId="$userIdTok$"
            ipAddress="$ipAddressTok$"
            messageId="$messageIdTok$"
          </query>
        </search>
        <option name="count">10</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <drilldown>
          <condition field="subject">
            <set token="subjectTok">$row.subject$</set>
            <set token="messageIdTok">*</set>
            <set token="userIdTok">*</set>
            <set token="ipAddressTok">*</set>
          </condition>
          <condition field="messageId">
            <set token="messageIdTok">$click.value2$</set>
            <set token="subjectTok">*</set>
            <set token="userIdTok">*</set>
            <set token="ipAddressTok">*</set>
          </condition>
          <condition field="UserId">
            <set token="messageIdTok">*</set>
            <set token="subjectTok">*</set>
            <set token="userIdTok">$row.UserId$</set>
            <set token="ipAddressTok">*</set>
          </condition>
          <condition field="ipAddress">
            <set token="messageIdTok">*</set>
            <set token="subjectTok">*</set>
            <set token="userIdTok">*</set>
            <set token="ipAddressTok">$row.ipAddress$</set>
          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
</form>

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

shaunm001
Path Finder

Nevermind....looks like using $click.value2$ solves the problem. 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...