<?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: Why are Search Filters not being applied in scripted authentication? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228569#M44506</link>
    <description>&lt;P&gt;Ok. The same restriction applies to user-based search filters, unfortunately. The plain truth is that no search filters whatsoever can be applied to accelerated data models or their objects. I'll update the documentation to reflect this.&lt;/P&gt;

&lt;P&gt;The fact that the filter isn't working for ordinary indexed data is puzzling, however, and I don't have any immediate suggestions to resolve it. If I do, I'll respond here. &lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2017 18:30:59 GMT</pubDate>
    <dc:creator>mattness</dc:creator>
    <dc:date>2017-02-03T18:30:59Z</dc:date>
    <item>
      <title>Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228565#M44502</link>
      <description>&lt;P&gt;Using Splunk Enterprise 6.4.1.  I am attempting to use scripted authentication to apply search filters to my users.  I can see that the script is being initiated and I can see calls being made to the getUsers and getUserInfo functions, however, I never see a call to the getSearchFilter function.  When I do the search, I can tell that no filters are being applied.  I just can't figure out why.  &lt;/P&gt;

&lt;P&gt;I created the authentication script.  The getSearchFilter method of said script returns results like:&lt;BR /&gt;
--status=success --search_filter=foo=1234 --search_filter=foo=3432 --search_filter=foo=8742&lt;/P&gt;

&lt;P&gt;With the above searchFilter, I expect to only see results where foo=1234 OR foo=3432 OR foo=8742.  But I am seeing many more values that that.  I set my authentication.conf up like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [authentication]
    authType = Scripted
    authSettings = script

    [script]
    scriptPath = "$SPLUNK_HOME/bin/python" "$SPLUNK_HOME/share/splunk/authScriptSamples/abactest.py"
    scriptSearchFilters = 1

    [cacheTiming]
    userLoginTTL    = 10s
    getUserInfoTTL  = 1min
    getUsersTTL     = 2mins
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I turned on debug for the AuthenticationManagerScripted, and see the following in the log file so I know the script is being run:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Initializing scripted auth with script path '"/opt/splunk/bin/python" "/opt/splunk/share/splunk/authScriptSamples/abactest.py"'
Scripted search filters: turned on
Calling script '"/opt/splunk/bin/python" "/opt/splunk/share/splunk/authScriptSamples/abactest.py"' getUsers' with arguments''
...
Found return key 'userInfo' with value 'lcarey;lcarey;l carey;admin:user'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228565#M44502</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2020-09-29T12:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228566#M44503</link>
      <description>&lt;P&gt;I figured out why the search filters are not being applied.  It was because the user had a role of 'admin' and the 'admin' role overrides searchFilters applied to the user.&lt;/P&gt;

&lt;P&gt;Other things I found while working on this:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;If you have a local splunk user with the same name as a scripted auth user, the local user takes precedence.  So, in my case, I removed the admin role from the user and still wasn't seeing the search filter be applied.   Turns out that I had a local splunk user with the same name that did NOT have search filters specified and that user has precedence.&lt;/LI&gt;
&lt;LI&gt;User search filters are NOT applied to tstats searches!&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 30 Jan 2017 21:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228566#M44503</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2017-01-30T21:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228567#M44504</link>
      <description>&lt;P&gt;You're partially correct about role-based search filters not being applied to tstats searches. By default they are applied to tstats searches of ordinary indexed data. But they are &lt;STRONG&gt;not&lt;/STRONG&gt; applied to tstats searches of accelerated data models and accelerated data model objects. There is a &lt;CODE&gt;tstats&lt;/CODE&gt; setting that you can use in &lt;CODE&gt;limits.conf&lt;/CODE&gt; to change this default.&lt;/P&gt;

&lt;P&gt;This is discussed in the documentation of the tstats command:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Tstats#Selecting_data"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Tstats#Selecting_data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 21:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228567#M44504</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2017-02-02T21:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228568#M44505</link>
      <description>&lt;P&gt;Actually,  user-based search Filters is what I was talking about.  The role-based ones work as advertised.  &lt;/P&gt;

&lt;P&gt;I am trying to use scripted authentication to apply a search filter per USER.  In that instance, the search filter is NOT applied to a tstats search even on  ordinary indexed data.  &lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 15:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228568#M44505</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2017-02-03T15:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228569#M44506</link>
      <description>&lt;P&gt;Ok. The same restriction applies to user-based search filters, unfortunately. The plain truth is that no search filters whatsoever can be applied to accelerated data models or their objects. I'll update the documentation to reflect this.&lt;/P&gt;

&lt;P&gt;The fact that the filter isn't working for ordinary indexed data is puzzling, however, and I don't have any immediate suggestions to resolve it. If I do, I'll respond here. &lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 18:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228569#M44506</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2017-02-03T18:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Search Filters not being applied in scripted authentication?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228570#M44507</link>
      <description>&lt;P&gt;Hi @lyndac - Did your answer above provide a  solution to your question? If yes, don't forget to click "Accept" to close out your question. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 00:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Search-Filters-not-being-applied-in-scripted/m-p/228570#M44507</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-02-14T00:48:46Z</dc:date>
    </item>
  </channel>
</rss>

