- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Help in setting up token based on User Value
shivamagrawa
Explorer
03-01-2021
04:18 AM
Hello,
I am trying to display couple of Dashboard Panels only to a specific user. For that i am trying to get the username and set the token if its matches with a certain value.
But somehow if i use condition tag its not working and "have_access" token is not getting set.
<row>
<panel>
<search>
<query>| rest /services/authentication/current-context splunk_server=local | eval access=if(username="kkan","True","False") | where access = True</query>
<preview>
<condition match=" 'job.resultCount' != 0">
<set token="have_access">True</set>
</condition>
</preview>
</search>
</panel>
</row>
<row>
<panel depends="$have_access$">
..............
Anyone , @niketn please help.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
SplunkTrust
03-01-2021
06:16 AM
Have you tried without the surrounding preview elements?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
shivamagrawa
Explorer
03-01-2021
06:53 AM
Yes, i have removed the preview tag, but getting the error..
Node <condition> is not allowed here
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
SplunkTrust
03-01-2021
07:07 AM
OK try <done> instead of <preview>
![](/skins/images/89D5ADE867CBAF0B5A525B7E23D83D7E/responsive_peak/images/icon_anonymous_message.png)