<?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 filter application search associated with user and owner? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283900#M190655</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Your question is very vague. Can you provide more details please?&lt;BR /&gt;
What exactly are you trying to achieve?&lt;/P&gt;

&lt;P&gt;If you just want to list reports or dashboards not accessed in the the last 60 days then take a look at this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/363829/how-can-filter-top-search-in-a-month-with-timefram.html"&gt;https://answers.splunk.com/answers/363829/how-can-filter-top-search-in-a-month-with-timefram.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to find out who ran what search:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/369183/splunk-searches-run-by-user.html"&gt;https://answers.splunk.com/answers/369183/splunk-searches-run-by-user.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Final query is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access earliest=-1y
 | rex field=uri "\/app\/(?&amp;lt;AppName&amp;gt;[\w-]+)\/(?&amp;lt;ViewName&amp;gt;[\w-\.]+)"
 | table _time, AppName, ViewName, user
 | search AppName=search AND ViewName=*
 | eval ViewName = if(match(ViewName, "\."), AppName, ViewName)
 | stats max(_time) as LastAccessed, last(user) as user by AppName, ViewName
 | eval age=round((now()-LastAccessed)/86400)
 | where age &amp;gt; 60
 | eval Date=strftime(LastAccessed,"%d-%m-%Y %H:%M:%S") 
 | join type=left ViewName [
    | rest /servicesNS/-/-/data/ui/views 
    | table author title 
    | rename title as ViewName author as owner]
 | table AppName, ViewName, Date, age, owner, user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Feb 2016 09:38:46 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-02-22T09:38:46Z</dc:date>
    <item>
      <title>How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283898#M190653</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I want to filter Application by  search with there owner of reports, search or dashboard. and who is not accessed in 60 days?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 17:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283898#M190653</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2016-02-17T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283899#M190654</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;Any answer for above issue?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2016 09:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283899#M190654</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2016-02-21T09:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283900#M190655</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Your question is very vague. Can you provide more details please?&lt;BR /&gt;
What exactly are you trying to achieve?&lt;/P&gt;

&lt;P&gt;If you just want to list reports or dashboards not accessed in the the last 60 days then take a look at this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/363829/how-can-filter-top-search-in-a-month-with-timefram.html"&gt;https://answers.splunk.com/answers/363829/how-can-filter-top-search-in-a-month-with-timefram.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to find out who ran what search:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/369183/splunk-searches-run-by-user.html"&gt;https://answers.splunk.com/answers/369183/splunk-searches-run-by-user.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Final query is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access earliest=-1y
 | rex field=uri "\/app\/(?&amp;lt;AppName&amp;gt;[\w-]+)\/(?&amp;lt;ViewName&amp;gt;[\w-\.]+)"
 | table _time, AppName, ViewName, user
 | search AppName=search AND ViewName=*
 | eval ViewName = if(match(ViewName, "\."), AppName, ViewName)
 | stats max(_time) as LastAccessed, last(user) as user by AppName, ViewName
 | eval age=round((now()-LastAccessed)/86400)
 | where age &amp;gt; 60
 | eval Date=strftime(LastAccessed,"%d-%m-%Y %H:%M:%S") 
 | join type=left ViewName [
    | rest /servicesNS/-/-/data/ui/views 
    | table author title 
    | rename title as ViewName author as owner]
 | table AppName, ViewName, Date, age, owner, user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 09:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283900#M190655</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-22T09:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283901#M190656</link>
      <description>&lt;P&gt;Hi J,&lt;/P&gt;

&lt;P&gt;I am looking at a similar search along with user field?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*access.log earliest=-2mon  */app/* | rex "\/app\/(?\w+)\/(?\w+)\"" | search AppName=search AND ViewName=* | stats max(_time) as LastAccessed by AppName, ViewName | eval age=now()-LastAccessed | where age&amp;gt; 20 |eval Date=strftime(LastAccessed,"%d-%m-%Y %H:%M:%S") | join type=left ViewName  [| rest /servicesNS/-/-/data/ui/views | table author title | rename title as ViewName author as owner ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 13:33:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283901#M190656</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2016-02-22T13:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283902#M190657</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you paste your query again but using the code button instead (the one with 1s and 0s)?&lt;BR /&gt;
Otherwise any special or reserved characters will be either omitted or behave differently.&lt;/P&gt;

&lt;P&gt;Based on your query above I'm &lt;EM&gt;guessing&lt;/EM&gt; you want to list Views not accessed in the last 20 days so I've made some modifications/fixes to your query and this is the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access earliest=-2mon
| rex field=uri "\/app\/(?&amp;lt;AppName&amp;gt;[\w-]+)\/(?&amp;lt;ViewName&amp;gt;[\w-\.]+)"
| table _time, AppName, ViewName
| search AppName=search AND ViewName=*
| eval ViewName = if(match(ViewName, "\."), AppName, ViewName)
| stats max(_time) as LastAccessed by AppName, ViewName
| eval age=round((now()-LastAccessed)/86400)
| where age &amp;gt; 20
| eval Date=strftime(LastAccessed,"%d-%m-%Y %H:%M:%S") 
| join type=left ViewName [
   | rest /servicesNS/-/-/data/ui/views 
   | table author title 
   | rename title as ViewName author as owner]
| fields - LastAccessed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AppName     ViewName    Date    age     owner
search  job_management  01-02-2016 21:22:33     21  nobody
search  search  01-02-2016 14:39:22     21  nobody 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this is not what you are trying to achieve please post an output example. Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# My expected output
AppName, ViewName, LastAccessed, Date, age, owner
X, Y, Z, 1, 2, 3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 15:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283902#M190657</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-22T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283903#M190658</link>
      <description>&lt;P&gt;Hi J,&lt;/P&gt;

&lt;P&gt;I missed to check your reply, It's look good which i was looking for  the "Search" App name Item which are not accessed in the last 60 days along with user field, so i can find out the owner who created the search Item and user who accessed the search item earlier(60 days ago).&lt;/P&gt;

&lt;P&gt;Can you describe me the output for below command in query:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval age=round((now()-LastAccessed)/86400)
| where age &amp;gt; 20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 16:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283903#M190658</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2016-02-23T16:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283904#M190659</link>
      <description>&lt;P&gt;Sure.&lt;/P&gt;

&lt;P&gt;Both now() and LastAccessed are in epoch format (seconds basically) so you need to divide them by 86400 seconds we have every day in order to display age in days.&lt;BR /&gt;
Then the where clause is just filtering by those events where age is greater than 20 days.&lt;/P&gt;

&lt;P&gt;Hope that makes sense.&lt;/P&gt;

&lt;P&gt;Based on your last comment I'm assuming the answer below is doing what you want so please confirm if that's the case.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 16:17:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283904#M190659</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-23T16:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283905#M190660</link>
      <description>&lt;P&gt;Hi J,&lt;/P&gt;

&lt;P&gt;I want these below field in my output such as :-&lt;/P&gt;

&lt;P&gt;App_Name:- search&lt;BR /&gt;
view_name:- anything&lt;BR /&gt;
Date:- &lt;BR /&gt;
age:- last 60 days &lt;BR /&gt;
Owner:- who created search item&lt;BR /&gt;
User:- who last time accessed those search item&lt;/P&gt;

&lt;P&gt;Similar output like this:-&lt;BR /&gt;
AppName     ViewName                     Date                          age     owner      user&lt;BR /&gt;
 search         job_management     01-02-2016 21:22:33     21     nobody    tarak&lt;/P&gt;

&lt;P&gt;Please let me know if any other details which i can provide you.&lt;BR /&gt;
Seems i am near to my solution.&lt;/P&gt;

&lt;P&gt;Thanks for your time to reply useful info.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283905#M190660</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2020-09-29T08:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283906#M190661</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Then simply add the user field to your first initial filter.&lt;BR /&gt;
Take a look at the following, it will query your logs for the last year but only return those where age is greater than 60 days. Feel free to play with the earliest and age values but the output is similar to the one you posted above. I have also updated my first answer.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access earliest=-1y
 | rex field=uri "\/app\/(?&amp;lt;AppName&amp;gt;[\w-]+)\/(?&amp;lt;ViewName&amp;gt;[\w-\.]+)"
 | table _time, AppName, ViewName, user
 | search AppName=search AND ViewName=*
 | eval ViewName = if(match(ViewName, "\."), AppName, ViewName)
 | stats max(_time) as LastAccessed, last(user) as user by AppName, ViewName
 | eval age=round((now()-LastAccessed)/86400)
 | where age &amp;gt; 60
 | eval Date=strftime(LastAccessed,"%d-%m-%Y %H:%M:%S") 
 | join type=left ViewName [
    | rest /servicesNS/-/-/data/ui/views 
    | table author title 
    | rename title as ViewName author as owner]
 | table AppName, ViewName, Date, age, owner, user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Feb 2016 10:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283906#M190661</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-24T10:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283907#M190662</link>
      <description>&lt;P&gt;Not getting any result from above query.....&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 07:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283907#M190662</guid>
      <dc:creator>vinodsinha</dc:creator>
      <dc:date>2016-02-25T07:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter application search associated with user and owner?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283908#M190663</link>
      <description>&lt;P&gt;Hi, the query above works fine when I run it.&lt;BR /&gt;
As i said before, you have to play with the values for age and earliest.&lt;BR /&gt;
If the above doesn't work it probably means there are now views where age  is greater than 60 days old in the last year (earliest=-1y)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 11:03:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-application-search-associated-with-user-and-owner/m-p/283908#M190663</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-25T11:03:17Z</dc:date>
    </item>
  </channel>
</rss>

