<?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 add the trigger time to loadjob? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488372#M136433</link>
    <description>&lt;P&gt;Just add this to the end of the search that you are pulling in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| addinfo | rename info_* AS _info_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob $sid$ | rename _info_search_time AS trigger_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Jan 2020 19:32:38 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2020-01-18T19:32:38Z</dc:date>
    <item>
      <title>How to add the trigger time to loadjob?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488369#M136430</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to pull out the last 24 hours worth of results for an alert using  &lt;CODE&gt;loadjob&lt;/CODE&gt;, with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
| map search="| loadjob $sid$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That works fine.&lt;/P&gt;

&lt;P&gt;I would like to add the column  &lt;CODE&gt;trigger_time&lt;/CODE&gt; to my results. I tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
| eval trigger_time = strftime(trigger_time,"%m/%d/%y %H:%M:%S") 
| table trigger_time 
| appendcols 
    [| search index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
    | map search="| loadjob $sid$"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This kind of works, but if there are multiple results from the  &lt;CODE&gt;loadjob&lt;/CODE&gt; command, it breaks (i.e. it shows the  &lt;CODE&gt;trigger_time&lt;/CODE&gt; but no results from  &lt;CODE&gt;loadjob&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
L&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 04:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488369#M136430</guid>
      <dc:creator>lwass</dc:creator>
      <dc:date>2020-01-17T04:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add the trigger time to loadjob?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488370#M136431</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
 | eval trigger_time = strftime(trigger_time,"%m/%d/%y %H:%M:%S") 
 | table trigger_time sid
 | appendpipe 
    [| map search="| loadjob $sid$"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't tried it, How about this?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 05:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488370#M136431</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-17T05:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add the trigger time to loadjob?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488371#M136432</link>
      <description>&lt;P&gt;@lwass &lt;/P&gt;

&lt;P&gt;If your first search working then I think below search can helps you. Can you please try this ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
| eval trigger_time = strftime(trigger_time,"%m/%d/%y %H:%M:%S") 
| map search="| loadjob $sid$ | eval trigger_time=\"$trigger_time$\"  " 
| table trigger_time *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit splunk_server="splunk-csh" action=alert_fired ss_name="myalert" 
| eval trigger_time = strftime(trigger_time,"%m/%d/%y %H:%M:%S") 
| map search="| loadjob $sid$ | eval trigger_time=\"$trigger_time$\"  | table trigger_time * " 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jan 2020 09:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488371#M136432</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-01-18T09:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add the trigger time to loadjob?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488372#M136433</link>
      <description>&lt;P&gt;Just add this to the end of the search that you are pulling in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| addinfo | rename info_* AS _info_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob $sid$ | rename _info_search_time AS trigger_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jan 2020 19:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-the-trigger-time-to-loadjob/m-p/488372#M136433</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-01-18T19:32:38Z</dc:date>
    </item>
  </channel>
</rss>

