<?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 How to edit my search to list jobs in a table per user, per day? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-list-jobs-in-a-table-per-user-per-day/m-p/320099#M95664</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;One of my co-workers is using a search to make a table listing the days the events of interest took place, as well as the corresponding User IDs on those days and the Jobs that are associated with it. So this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_name date_wday=* User=* Job=*  | bucket span=1d _time |stats count by date_wday User Job _time | search count &amp;gt;25 | stats values(_time) as time list(User) as UserID  values(Job) as JobName list(count) as count  by date_wday | eval Time=strftime(time, "%m-%d-%Y") | fields - time | table Time, date_wday, UserID,JobName,count | sort - Time | rename date_wday as Day_of_week
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Creates something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-19-2017   |     wednesday    |         User1      |         Job1                   |              34
             |                  |          User2      |         Job2                   |              45
             |                  |          User3      |         Job3                   |              34
             |                  |          User3      |         Job4                   |              32
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works fine, but I'm wondering if it is possible to set this up so that if a user is associated with multiple jobs, the jobs appear in one line, as opposed to another entry of the user.  For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-19-2017   |     wednesday    |         User1      |         Job1                   |              34
             |                  |          User2      |         Job2                   |              45
             |                  |          User3      |         Job3, Job4             |              34
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this even possible using the search queries, though?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 19:49:28 GMT</pubDate>
    <dc:creator>Svill321</dc:creator>
    <dc:date>2017-07-19T19:49:28Z</dc:date>
    <item>
      <title>How to edit my search to list jobs in a table per user, per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-list-jobs-in-a-table-per-user-per-day/m-p/320099#M95664</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;One of my co-workers is using a search to make a table listing the days the events of interest took place, as well as the corresponding User IDs on those days and the Jobs that are associated with it. So this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_name date_wday=* User=* Job=*  | bucket span=1d _time |stats count by date_wday User Job _time | search count &amp;gt;25 | stats values(_time) as time list(User) as UserID  values(Job) as JobName list(count) as count  by date_wday | eval Time=strftime(time, "%m-%d-%Y") | fields - time | table Time, date_wday, UserID,JobName,count | sort - Time | rename date_wday as Day_of_week
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Creates something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-19-2017   |     wednesday    |         User1      |         Job1                   |              34
             |                  |          User2      |         Job2                   |              45
             |                  |          User3      |         Job3                   |              34
             |                  |          User3      |         Job4                   |              32
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works fine, but I'm wondering if it is possible to set this up so that if a user is associated with multiple jobs, the jobs appear in one line, as opposed to another entry of the user.  For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-19-2017   |     wednesday    |         User1      |         Job1                   |              34
             |                  |          User2      |         Job2                   |              45
             |                  |          User3      |         Job3, Job4             |              34
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this even possible using the search queries, though?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 19:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-list-jobs-in-a-table-per-user-per-day/m-p/320099#M95664</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-19T19:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to list jobs in a table per user, per day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-list-jobs-in-a-table-per-user-per-day/m-p/320100#M95665</link>
      <description>&lt;P&gt;Give this a try (deriving date_wday from _time itself for more accuracy)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_name User=* Job=*  | bucket span=1d _time 
|stats count by User Job _time | search count &amp;gt;25 
| stats sum(count) as count values(Job) as Job by _time User delim="," | nomv Job
| stats list(User) as UserID  list(Job) as JobName list(count) as count  by _time 
| eval Time=strftime(_time, "%m-%d-%Y") | eval Day_of_week=strftime(_time,"%A") 
| table Time, Day_of_week, UserID,JobName,count | sort - Time 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 20:40:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-list-jobs-in-a-table-per-user-per-day/m-p/320100#M95665</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-19T20:40:12Z</dc:date>
    </item>
  </channel>
</rss>

