<?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: Is it possible to define multiple evals as default for each search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464937#M131004</link>
    <description>&lt;P&gt;@HeinzWaescher &lt;/P&gt;

&lt;P&gt;I think it is not possible. But to achieve this, you have to create a &lt;CODE&gt;macro&lt;/CODE&gt; with below search which can be use in all searches.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _raw=split(_raw, user)
| eval user_hash=sha256(user)
| eval _raw=mvjoin(_raw, user_hash)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index=main `my_macro`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/Knowledge/Definesearchmacros"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/Knowledge/Definesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 07:00:11 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-10-23T07:00:11Z</dc:date>
    <item>
      <title>Is it possible to define multiple evals as default for each search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464936#M131003</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to know whether it is possible to perform something like this per default for each and every search in the background:&lt;/P&gt;

&lt;P&gt;| eval _raw=split(_raw, user)&lt;BR /&gt;
| eval user_hash=sha256(user)&lt;BR /&gt;
| eval _raw=mvjoin(_raw, user_hash)&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464936#M131003</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2020-09-30T02:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to define multiple evals as default for each search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464937#M131004</link>
      <description>&lt;P&gt;@HeinzWaescher &lt;/P&gt;

&lt;P&gt;I think it is not possible. But to achieve this, you have to create a &lt;CODE&gt;macro&lt;/CODE&gt; with below search which can be use in all searches.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _raw=split(_raw, user)
| eval user_hash=sha256(user)
| eval _raw=mvjoin(_raw, user_hash)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index=main `my_macro`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/Knowledge/Definesearchmacros"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/Knowledge/Definesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464937#M131004</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-10-23T07:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to define multiple evals as default for each search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464938#M131005</link>
      <description>&lt;P&gt;I thought about using macros. But I would like have a solution that the user don't have to use actively.&lt;BR /&gt;
It should be done by default for a defined role.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464938#M131005</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2019-10-23T07:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to define multiple evals as default for each search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464939#M131006</link>
      <description>&lt;P&gt;If you know the user,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user user_hash
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It would be nice to create a CSV with the value of and auto lookup&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 00:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464939#M131006</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-10-26T00:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to define multiple evals as default for each search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464940#M131007</link>
      <description>&lt;P&gt;before i go further, your search is very heavy as it calculates all data and hashes user, if you want to mask the user field, you can do it at index time with &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;tranforms.conf&lt;/CODE&gt; also, check out the new feature in Splunk 8.0 around work with data before its indexed&lt;BR /&gt;
i think the closest to what you are after is: "search filters" however, although they have some downsides, &lt;BR /&gt;
read here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Security/Addandeditroles#Specify_search_restrictions_for_a_role"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Security/Addandeditroles#Specify_search_restrictions_for_a_role&lt;/A&gt;&lt;BR /&gt;
there is another doc that i cant find at the moment.&lt;BR /&gt;
regardless, i think that what @kamlesh_vaghela  suggested (macros) is a better solution, as you will can also put variables in them and they are knowledge objects and not roles configuration.&lt;/P&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 01:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-define-multiple-evals-as-default-for-each/m-p/464940#M131007</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-10-26T01:53:31Z</dc:date>
    </item>
  </channel>
</rss>

