<?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: How to token in an eval sha256 function under a Simple XML drilldown condition in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417597#M27492</link>
    <description>&lt;P&gt;This is what I wound up doing, as the calc for sha256 did not take that long per url.&lt;/P&gt;

&lt;P&gt;| eval "sha_url_tok"=sha256(url)&lt;/P&gt;

&lt;P&gt;Then passed the $sha_url_tok$ out to the Virustotal API.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:06:52 GMT</pubDate>
    <dc:creator>cjenkins666</dc:creator>
    <dc:date>2020-09-30T01:06:52Z</dc:date>
    <item>
      <title>How to token in an eval sha256 function under a Simple XML drilldown condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417593#M27488</link>
      <description>&lt;P&gt;I am trying to pass a url token from my dashboard search results, to VirusTotal, based on the parameters they require.&lt;BR /&gt;
I need to pass the SHA256 value of the URL string, as well as the url string itself to Virustotal.&lt;/P&gt;

&lt;P&gt;Here is the format needed by Virustotal and an example:&lt;BR /&gt;
&lt;A href="https://www.virustotal.com/gui/url/%5Bsha256"&gt;https://www.virustotal.com/gui/url/[sha256&lt;/A&gt; of url]/detection?q=[url string]&lt;/P&gt;

&lt;P&gt;Example: &lt;A href="https://www.virustotal.com/gui/url/1a1008c3ddbeb9a1b57f0b358527a65597a00cf5fcd5b43297e1148f423dff57/detection?q=http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571"&gt;https://www.virustotal.com/gui/url/1a1008c3ddbeb9a1b57f0b358527a65597a00cf5fcd5b43297e1148f423dff57/detection?q=http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In my drilldown condition I have this syntax for passing the row field value and transforming it to a sha256 value using eval statement.&lt;BR /&gt;
Problem is the sha256() function does not appear to work, the value passed is the whole eval line?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;condition field="Url"&amp;gt;
        &amp;lt;eval token="sha_url_tok"&amp;gt;sha256($row.Url$)&amp;lt;/eval&amp;gt;
        &amp;lt;link target="_blank"&amp;gt;https://www.virustotal.com/gui/home/url/$sha_url_tok$/detection?q=$row.Url$&amp;lt;/link&amp;gt;
      &amp;lt;/condition&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried all these formats with no success:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sha256("\"row.Url"\")
sha256($row.Url$)
sha256("$row.Url$")
sha256('row.Url')
sha256('$row.Url$')
sha256(row.Url)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the output I get, where the sha256 function is passed as a whole statement along with the eval syntax, and the &lt;CODE&gt;$row.Url$&lt;/CODE&gt; token after the  &lt;CODE&gt;"detection?q="&lt;/CODE&gt; is passed correctly. Only the output from sha256 function is not being processed correclty.&lt;/P&gt;

&lt;P&gt;Output:&lt;BR /&gt;
&lt;A href="https://www.virustotal.com/gui/home/url/eval%20sha256(http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571)/detection?q=http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571"&gt;https://www.virustotal.com/gui/home/url/eval%20sha256(http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571)/detection?q=http%3A%2F%2Fbodelen.com%2Fapu.php%3Fzoneid%5C%3D1587571&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any ides on how to get the sha256 function to work properly?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 17:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417593#M27488</guid>
      <dc:creator>cjenkins666</dc:creator>
      <dc:date>2019-06-10T17:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to token in an eval sha256 function under a Simple XML drilldown condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417594#M27489</link>
      <description>&lt;P&gt;I resolved this with a workaround, in my base search I added the eval statement to create a token that did the sha256 for each value that had a url. Then referenced that in my link to Virustotal. &lt;/P&gt;

&lt;P&gt;| eval "sha_url_tok"=sha256(url)&lt;/P&gt;

&lt;P&gt;This is not ideal, in that it does the sha256 on every url in my search results. What I want is to do it only when the url is clicked in the search results panel.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417594#M27489</guid>
      <dc:creator>cjenkins666</dc:creator>
      <dc:date>2020-09-30T00:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to token in an eval sha256 function under a Simple XML drilldown condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417595#M27490</link>
      <description>&lt;P&gt;you can hide the parameter from what is displayed by using &lt;CODE&gt;&amp;lt;fields&amp;gt;&amp;lt;/fields&amp;gt;&lt;/CODE&gt; in your dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;base search
          | eval "sha_url_tok"=sha256(url)
          | table Url sha_url_tok &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;fields&amp;gt;["Url"]&amp;lt;/fields&amp;gt;
        &amp;lt;drilldown&amp;gt;
         &amp;lt;condition field="Url"&amp;gt;
         &amp;lt;link target="_blank"&amp;gt;https://www.virustotal.com/gui/home/url/$sha_url_tok$/detection?q=$row.Url$&amp;lt;/link&amp;gt;
       &amp;lt;/condition&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jun 2019 19:24:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417595#M27490</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2019-06-11T19:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to token in an eval sha256 function under a Simple XML drilldown condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417596#M27491</link>
      <description>&lt;P&gt;virus&lt;/P&gt;

&lt;P&gt;true&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel depends="$bb$" rejects="$aa$"&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| makeresults | eval Url="https://answers.splunk.com/answers/751606/how-to-token-in-an-eval-sha256-function-under-a-si.html" | table Url | eval sha=sha256(Url)&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;
    &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
    &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
    &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;condition field="Url"&amp;gt;
        &amp;lt;set token="aa"&amp;gt;&amp;lt;/set&amp;gt;
        &amp;lt;unset token="bb"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;link target="_blank"&amp;gt;https://www.virustotal.com/gui/url/$row.sha$&amp;lt;/link&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/drilldown&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
 &amp;lt;panel depends="$aa$" rejects="$bb$"&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| makeresults | eval Url="https://answers.splunk.com/answers/751606/how-to-token-in-an-eval-sha256-function-under-a-si.html" | table Url &amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;
    &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
    &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
    &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;set token="bb"&amp;gt;&amp;lt;/set&amp;gt;
        &amp;lt;unset token="aa"&amp;gt;&amp;lt;/unset&amp;gt;
    &amp;lt;/drilldown&amp;gt;

  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use two panels the one will be hidden at a time. Only the thing is you have to click two times to get the answer. You can use this logic.&lt;BR /&gt;
Also, you have to use the init tag to set the "bb" token at  the starting of the dashboard&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 06:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417596#M27491</guid>
      <dc:creator>maityayan1996</dc:creator>
      <dc:date>2019-06-14T06:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to token in an eval sha256 function under a Simple XML drilldown condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417597#M27492</link>
      <description>&lt;P&gt;This is what I wound up doing, as the calc for sha256 did not take that long per url.&lt;/P&gt;

&lt;P&gt;| eval "sha_url_tok"=sha256(url)&lt;/P&gt;

&lt;P&gt;Then passed the $sha_url_tok$ out to the Virustotal API.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-token-in-an-eval-sha256-function-under-a-Simple-XML/m-p/417597#M27492</guid>
      <dc:creator>cjenkins666</dc:creator>
      <dc:date>2020-09-30T01:06:52Z</dc:date>
    </item>
  </channel>
</rss>

