<?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: _time passed to Workflow Search string not formatted in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498353#M61320</link>
    <description>&lt;P&gt;Hey All,&lt;/P&gt;

&lt;P&gt;We finally found a solution to this but it didn't exist within the output search command.  We ended up modifying a couple of the python scripts within the ServiceNow Security Operations app to extract the _time based on a special character placed before the string then convert to ISO format then pass back to the function that sent it to the API.  We were also able to insert line breaks into the data once it was placed in the Description field of ServiceNow using a similar method.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 18:25:42 GMT</pubDate>
    <dc:creator>adalbor</dc:creator>
    <dc:date>2020-02-12T18:25:42Z</dc:date>
    <item>
      <title>_time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498340#M61307</link>
      <description>&lt;P&gt;Hey All,&lt;/P&gt;

&lt;P&gt;I have a workflow action that passes a search string to an external app (ServiceNow) for incident creation. When I use the $_time$ token it uses epoch not the properly formatted time.  I am unable to use an eval in the search string because the first command of the search string must be the ServiceNow parameter to call the script. Anyone have any suggestions how I could pass the properly formatted time?&lt;/P&gt;

&lt;P&gt;This is what I have currently:&lt;/P&gt;

&lt;P&gt;| snsecincident short_description "$sn_fe_hx_shortdesc$ $sn_fe_ips_shortdesc$ $sn_pa_threat_shortdesc$ $sn_ms_def_shortdesc$ on $sn_fe_hx_srchost$ $sn_fe_ips_dst$ $sn_ms_def_compname$ $sn_pa_threat_src$ at $Time$" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "$sn_fe_hx_srchost$ $sn_ms_def_compname$ $sn_fe_ips_shost$" description "BLAH BLAH"&lt;/P&gt;

&lt;P&gt;If  I try this before the snsecincident:&lt;BR /&gt;
| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N")  | rename _time as Time &lt;BR /&gt;
I receive an error that the snsecincident has to be the first command in the string.&lt;/P&gt;

&lt;P&gt;Should I create a field alias for _time that is formatted properly and use that? If so how would I go about that?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:57:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498340#M61307</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-09-30T03:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498341#M61308</link>
      <description>&lt;P&gt;Have you tried appending the results of your &lt;CODE&gt;snsecincident&lt;/CODE&gt; search? &lt;/P&gt;

&lt;P&gt;If you &lt;CODE&gt;append&lt;/CODE&gt; the &lt;CODE&gt;| eval _time&lt;/CODE&gt; part of your search at the end the append will run this 'subsearch' first. &lt;/P&gt;

&lt;P&gt;So your search could look like this:&lt;/P&gt;

&lt;P&gt;**&lt;BR /&gt;
| snsecincident short_description "$sn_fe_hx_shortdesc$ $sn_fe_ips_shortdesc$ $sn_pa_threat_shortdesc$ $sn_ms_def_shortdesc$ on $sn_fe_hx_srchost$ $sn_fe_ips_dst$ $sn_ms_def_compname$ $sn_pa_threat_src$ at $Time$" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "$sn_fe_hx_srchost$ $sn_ms_def_compname$ $sn_fe_ips_shost$" description "etc, blah"&lt;BR /&gt;
| append [| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N") | rename _time as Time ]&lt;BR /&gt;
**&lt;BR /&gt;
And may help resolve your epoch time conversion to the format you desire. &lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498341#M61308</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-09-30T03:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498342#M61309</link>
      <description>&lt;P&gt;Just  tried what you suggested but still a no-go  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What I have currently:&lt;BR /&gt;
| snsecincident short_description "$sn_fe_hx_shortdesc$ $sn_fe_ips_shortdesc$ $sn_pa_threat_shortdesc$ $sn_ms_def_shortdesc$ on $sn_fe_hx_srchost$ $sn_fe_ips_dst$ $sn_ms_def_compname$ $sn_pa_threat_src$ at $Time$" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "$sn_fe_hx_srchost$ $sn_ms_def_compname$ $sn_fe_ips_shost$" description "BLAH BLAH" | append [| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N") | rename _time as Time ]&lt;/P&gt;

&lt;P&gt;Doesnt appear to run the append because the time field is blank on the resulting search page the workflow opens.&lt;/P&gt;

&lt;P&gt;If I click on an event to spawn the incident creation I have the option checked to open the search command workflow in another window to see what it is passing.&lt;/P&gt;

&lt;P&gt;After the change you suggested this is what the output is:&lt;BR /&gt;
| snsecincident short_description "Blah Alert    on xxxxxx    at " category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "xxxxxx  " description "BLAH BLAH" | append [| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N") | rename _time as Time ]&lt;/P&gt;

&lt;P&gt;When everything sorta works this is what that result looks like:&lt;BR /&gt;
| snsecincident short_description "Blah Alert    on xxxxx    at 1579880590" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "xxxxx  " description "BLAH BLAH"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498342#M61309</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-09-30T03:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498343#M61310</link>
      <description>&lt;P&gt;Maybe remove the rename _time as Time and switch the token to grab$ _time$. If you are not getting any resulting time fields with the rest of the event then there may be something wrong with the token being grabbed and then you rename it.&lt;/P&gt;

&lt;P&gt;So maybe try&lt;/P&gt;

&lt;P&gt;**&lt;BR /&gt;
| snsecincident short_description "$sn_fe_hx_shortdesc$ $sn_fe_ips_shortdesc$ $sn_pa_threat_shortdesc$ $sn_ms_def_shortdesc$ on $sn_fe_hx_srchost$ $sn_fe_ips_dst$ $sn_ms_def_compname$ $sn_pa_threat_src$ at $_time$" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "$sn_fe_hx_srchost$ $sn_ms_def_compname$ $sn_fe_ips_shost$" description "BLAH BLAH" | append [| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N") ]&lt;BR /&gt;
**&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498343#M61310</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-09-30T03:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498344#M61311</link>
      <description>&lt;P&gt;That unfortunately didnt work either.&lt;/P&gt;

&lt;P&gt;Output of search command:&lt;BR /&gt;
| snsecincident short_description "Blah Alert    on xxxxx    at 1579880590" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "xxxxx  " description "BLAH BLAH" | append [| eval _time = strftime(_time,"%Y-%m-%d %H:%M:%S.%3N") ]&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498344#M61311</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-09-30T03:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498345#M61312</link>
      <description>&lt;P&gt;I am working on this. I just got some mock data in epoch time I can try and replicate locally. &lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498345#M61312</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-01-31T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498346#M61313</link>
      <description>&lt;P&gt;You may not even need the append to run the search. I just added the &lt;CODE&gt;| eval _time=strftime(_time,"%Y-%m-%d %H:%M:%S.%3N")&lt;/CODE&gt; to the end of my search and it formatted _time. I am not using a token format. Do you have to use &lt;STRONG&gt;$_time$&lt;/STRONG&gt; to execute the &lt;CODE&gt;| snsecincident&lt;/CODE&gt; search?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498346#M61313</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-09-30T03:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498347#M61314</link>
      <description>&lt;P&gt;So the reason I have to use $_time$ is because I am passing that as a token to a third party app.  Essentially the search command I am providing is the result of a workflow action built into TA-ServiceNow-SecOps. The search command on the backend (snsecincident) runs a script that connects to the ServiceNow Instance and creates a security incident based on the tokens in that search command.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 15:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498347#M61314</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-01-31T15:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498348#M61315</link>
      <description>&lt;P&gt;Okay. Can you just try adding the &lt;CODE&gt;| eval _time=strftime(_time,"%Y-%m-%d %H:%M:%S.%3N")&lt;/CODE&gt; to the end of your search?&lt;/P&gt;

&lt;P&gt;So your search would be &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;| snsecincident short_description "$sn_fe_hx_shortdesc$ $sn_fe_ips_shortdesc$ $sn_pa_threat_shortdesc$ $sn_ms_def_shortdesc$ on $sn_fe_hx_srchost$ $sn_fe_ips_dst$ $sn_ms_def_compname$ $sn_pa_threat_src$ at $_time$" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "$sn_fe_hx_srchost$ $sn_ms_def_compname$ $sn_fe_ips_shost$" description "BLAH BLAH" | eval _time=strftime(_time, "%Y-%m-%d %H:%M:%S.%3N")&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498348#M61315</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-09-30T03:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498349#M61316</link>
      <description>&lt;P&gt;It definitely doesn't like having an extra command added to the end.  Same results as before where it ignores that part of the search command &lt;/P&gt;

&lt;P&gt;Output:&lt;BR /&gt;
| snsecincident short_description "Fireeye HX Alert    on xxxxxat 1579880575" category "Splunk Generated Incident" subcategory "Security Alert" cmdb_ci "xxxxxx" description "BLAH BLAH" eval _time=strftime(_time, "%Y-%m-%d %H:%M:%S.%3N")&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498349#M61316</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-09-30T04:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498350#M61317</link>
      <description>&lt;P&gt;I wish I could help and try and replicate your environment. Keep trying, maybe see if you can &lt;CODE&gt;| rex&lt;/CODE&gt; out the epoch time as a new field then eval that? Not sure what else I can suggest. &lt;/P&gt;

&lt;P&gt;Hope you can figure it out!&lt;/P&gt;

&lt;P&gt;13tsavage&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 17:06:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498350#M61317</guid>
      <dc:creator>13tsavage</dc:creator>
      <dc:date>2020-01-31T17:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498351#M61318</link>
      <description>&lt;P&gt;Thanks for all the time you devoted to helping!&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 18:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498351#M61318</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-01-31T18:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498352#M61319</link>
      <description>&lt;P&gt;Does anyone know if its possible to create a field alias for _time with it properly formatted?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 20:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498352#M61319</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-02-03T20:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: _time passed to Workflow Search string not formatted</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498353#M61320</link>
      <description>&lt;P&gt;Hey All,&lt;/P&gt;

&lt;P&gt;We finally found a solution to this but it didn't exist within the output search command.  We ended up modifying a couple of the python scripts within the ServiceNow Security Operations app to extract the _time based on a special character placed before the string then convert to ISO format then pass back to the function that sent it to the API.  We were also able to insert line breaks into the data once it was placed in the Description field of ServiceNow using a similar method.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/time-passed-to-Workflow-Search-string-not-formatted/m-p/498353#M61320</guid>
      <dc:creator>adalbor</dc:creator>
      <dc:date>2020-02-12T18:25:42Z</dc:date>
    </item>
  </channel>
</rss>

