<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dashboard Studio earliest/latest tokens in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/694075#M236095</link>
    <description>&lt;P&gt;Thanks for replying, and sorry for the lengthy delay.&amp;nbsp; Metrics dashboards never seem to be the priority!&lt;/P&gt;&lt;P&gt;Changing the token names did not work, panel 2 doesn't load.&amp;nbsp; I continue to get the red ! in the top right, asking for "&lt;SPAN&gt;Set token value to render visualization" specifically for $latest_time$ (or whatever name variation I try).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 15:26:43 GMT</pubDate>
    <dc:creator>Gregs1125</dc:creator>
    <dc:date>2024-07-23T15:26:43Z</dc:date>
    <item>
      <title>Dashboard Studio earliest/latest tokens</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/691740#M235516</link>
      <description>&lt;P&gt;I'm trying to pass 3 tokens from panel 1 into panel 2, earliest time, latest time, and a basic field value.&amp;nbsp; I can get the earliest time and field value to work, but latest time always defaults to "now" no matter what I try.&lt;/P&gt;
&lt;P&gt;Panel 1 is a stacked timechart over a three week period, each stack is one week.&amp;nbsp; The values in the stack are different closure statuses from my SIEM.&amp;nbsp; I want to be able to click on a closure status in a single week and see the details of just the statuses from that week in panel 2. (ex. Mon Jun 17-Sun Jun 23)&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Panel 1 looks like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=siem sourcetype=triage | eval _time=relative_time(_time,"@w1") ```so my stacks start on monday```
| timechart span=1w@w1 count by status WHERE max in top10 useother=false
| eval last=_time+604800  ```manually creating a latest time to use as token```&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;note: panel 1 is using a time input shared across most panels in the dashboard. (defaulting to 3 Mondays ago)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In Configuration &amp;gt; Interaction, I'm setting 3 tokens, status=name, earliest=row._time.value, and latest=row.last.value&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Panel 2 looks like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=siem sourcetype=triage earliest=$earliest$ latest=$latest$ | rest of search&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I click a status in week 1 (2 weeks ago) I get statuses for weeks 1, 2, and 3. (earliest and status token is working)&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When I click a status in week 2 (1 weeks ago) I get statuses for weeks 2 and 3 (earliest and status token is working)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;When I click a status in week 3 (current week) I get the current week.&amp;nbsp; (earliest and status token is working&lt;/P&gt;
&lt;P&gt;Latest always defaults to now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've done something similar in the old dashboard, I eval'd the time modifiers while setting the token, but am much less familiar with json, not sure if this is a possibility.&lt;/P&gt;
&lt;P&gt;What I had previously done:&amp;nbsp;&lt;SPAN&gt;&amp;lt;eval token="earliest"&amp;gt;$click.value$-3600&amp;lt;/eval&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 20:58:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/691740#M235516</guid>
      <dc:creator>Gregs1125</dc:creator>
      <dc:date>2024-06-26T20:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Studio earliest/latest tokens</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/691741#M235517</link>
      <description>&lt;P&gt;Try using different token names e.g. earliest_time and latest_time&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 20:35:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/691741#M235517</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-26T20:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Studio earliest/latest tokens</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/694075#M236095</link>
      <description>&lt;P&gt;Thanks for replying, and sorry for the lengthy delay.&amp;nbsp; Metrics dashboards never seem to be the priority!&lt;/P&gt;&lt;P&gt;Changing the token names did not work, panel 2 doesn't load.&amp;nbsp; I continue to get the red ! in the top right, asking for "&lt;SPAN&gt;Set token value to render visualization" specifically for $latest_time$ (or whatever name variation I try).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 15:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/694075#M236095</guid>
      <dc:creator>Gregs1125</dc:creator>
      <dc:date>2024-07-23T15:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Studio earliest/latest tokens</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/694129#M236104</link>
      <description>&lt;P&gt;Your requirement isn't really clear. &amp;nbsp;Not to point to the obvious difference between &lt;FONT face="courier new,courier"&gt;last&lt;/FONT&gt;&amp;nbsp;(set in first panel) and &lt;FONT face="courier new,courier"&gt;$latest$&lt;/FONT&gt; (used in second panel), but are you sure you can even add an additional field in the first panel and still maintain your original timechart? (Hint: It will ruin it all; at least it will distort the chart.)&lt;/P&gt;&lt;P&gt;Another important question is: What is that $latest$ expected &amp;nbsp;supposed to be? &amp;nbsp;It seems that you want it to be the interactive token because you set it according to _time which varies by row. &amp;nbsp;I already mentioned that setting a new field after timechart will ruin your chart. &amp;nbsp;But in addition, Dashboard Studio has its own regiment to manage tokens. &amp;nbsp;You cannot set a variable in one search and call that variable with $$ and expect it to be a passable token. &amp;nbsp;This is the document about setting interactive token with search result:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/DashStudio/searchTokens" target="_blank" rel="noopener"&gt;Setting tokens from search results or search job metadata&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Then, to add 1 week to the click value, run that result in another search. (Just like you would do in Simple XML.) &amp;nbsp;Lastly, use result from that search to drive the second panel. &amp;nbsp;Here is an example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "visualizations": {
        "viz_7yE1ZwsT": {
            "type": "splunk.line",
            "dataSources": {
                "primary": "ds_DmIKSSCN"
            },
            "title": "First panel",
            "eventHandlers": [
                {
                    "type": "drilldown.setToken",
                    "options": {
                        "tokens": [
                            {
                                "token": "latest_tok",
                                "key": "row._time.value"
                            }
                        ]
                    }
                }
            ],
            "options": {
                "legendDisplay": "top"
            }
        },
        "viz_OIqDnl0b": {
            "type": "splunk.line",
            "options": {
                "legendDisplay": "bottom"
            },
            "dataSources": {
                "primary": "ds_79fdaiuf"
            },
            "showProgressBar": false,
            "showLastUpdated": false
        }
    },
    "dataSources": {
        "ds_DmIKSSCN": {
            "type": "ds.search",
            "options": {
                "query": "| tstats count where index=_internal by _time span=1d sourcetype\n| timechart span=1d sum(count) by sourcetype\n| eval _last = relative_time(_time, \"+1w\")"
            },
            "name": "first panel"
        },
        "ds_79fdaiuf": {
            "type": "ds.search",
            "options": {
                "query": "index=_introspection latest=$make token:result.week_after$\n| timechart span=1d count by sourcetype"
            },
            "name": "dependent panel"
        },
        "ds_EHm1QhZI": {
            "type": "ds.search",
            "options": {
                "query": "| makeresults\n| eval week_after = relative_time($latest_tok$, \"+1w\")",
                "enableSmartSources": true
            },
            "name": "make token"
        }
    },
    "defaults": {
        "dataSources": {
            "ds.search": {
                "options": {
                    "queryParameters": {
                        "latest": "$global_time.latest$",
                        "earliest": "$global_time.earliest$"
                    }
                }
            }
        }
    },
    "inputs": {
        "input_global_trp": {
            "type": "input.timerange",
            "options": {
                "token": "global_time",
                "defaultValue": "-3w@w,now"
            },
            "title": "Global Time Range"
        }
    },
    "layout": {
        "type": "grid",
        "options": {
            "width": 1440,
            "height": 960
        },
        "structure": [
            {
                "item": "viz_7yE1ZwsT",
                "type": "block",
                "position": {
                    "x": 0,
                    "y": 0,
                    "w": 1440,
                    "h": 400
                }
            },
            {
                "item": "viz_OIqDnl0b",
                "type": "block",
                "position": {
                    "x": 0,
                    "y": 400,
                    "w": 1440,
                    "h": 400
                }
            }
        ],
        "globalInputs": [
            "input_global_trp"
        ]
    },
    "description": "https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/691740",
    "title": "Pass time token"
}&lt;/LI-CODE&gt;&lt;P&gt;In this dashboard, when you click a point on July 13 in the first panel, the second panel will end on July 20. &amp;nbsp;Is this something you are looking at?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 05:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-Studio-earliest-latest-tokens/m-p/694129#M236104</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-07-24T05:18:13Z</dc:date>
    </item>
  </channel>
</rss>

