<?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: Rename same field different things in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21655#M3579</link>
    <description>&lt;P&gt;You're absolutely right. Take out the NOT.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Apr 2012 20:11:54 GMT</pubDate>
    <dc:creator>Stephen_Sorkin</dc:creator>
    <dc:date>2012-04-08T20:11:54Z</dc:date>
    <item>
      <title>Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21647#M3571</link>
      <description>&lt;P&gt;I have a search using transaction and the startswith/endswith but I don't know how to call the Task_time field in the starts with of my transaction "Encode Time" and the Task_time field in the ends with "Transfer Time"?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21647#M3571</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2020-09-28T11:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21648#M3572</link>
      <description>&lt;P&gt;You can use eval to achieve this, by evaluating those fields before the transaction. Suppose the initial event includes the word "Encode" and the final event contains the word "Transfer": For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Encode_Time=if(searchmatch("Encode"), Task_time, null())
| eval Transfer_time=if(searchmatch("Transfer",Task_time, null()
| transaction &amp;lt;uid&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternately, if the Encode event really starts the transaction and the Transfer event really ends it, you can just use eval after the transaction to pick the values of the Task_time multivalued field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction &amp;lt;uid&amp;gt;
| eval Encode_time = mvindex(Task_time, 0)
| eval Transfer_time = mvindex(Task_time, -1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Apr 2012 00:12:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21648#M3572</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T00:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21649#M3573</link>
      <description>&lt;P&gt;hmm ok I think we are getting somewhere, but encode and transfer are not really events they are simply strings. I'm forcing them to be the first and last in the transaction by using the starts with/ends with parameters&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 03:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21649#M3573</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-08T03:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21650#M3574</link>
      <description>&lt;P&gt;Here's my search as it currently stands:&lt;/P&gt;

&lt;P&gt;index=myindex sourcetype=box-app host=box04* OR host=box050 | transaction task_id startswith="SUCCESS : 100% :  Encode completed" endswith="SUCCESS : 100% :  (PUSH) completed" | eval starswith = mvindex(Task_time, 0) | rename Task_time AS " Encode" | eval endswith = mvindex(Task_time, -1) | rename Task_time AS "Copy Transfer" | fields " Encode" "Copy Transfer"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:38:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21650#M3574</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2020-09-28T11:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21651#M3575</link>
      <description>&lt;P&gt;You should be able to search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=myindex sourcetype=box-app host=box04* OR host=box050 | transaction task_id startswith="SUCCESS : 100% :  Encode completed" endswith="SUCCESS : 100% :  (PUSH) completed" | eval Encode = mvindex(Task_time, 0) | eval "Copy Transfer" = mvindex(Task_time, -1) | table "Encode" "Copy Transfer"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 17:23:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21651#M3575</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T17:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21652#M3576</link>
      <description>&lt;P&gt;doesent seem to work i get  all the resutls within my start/end transaction. Not just the two above that I'm looking for. They all have &lt;BR /&gt;
Task_time fields and I cant tell which ones are which if I cant rename them approprately.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 19:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21652#M3576</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-08T19:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21653#M3577</link>
      <description>&lt;P&gt;If you want to exclude other events from the transaction, you can add to the search part before the first pipe: &lt;CODE&gt;NOT ("SUCCESS : 100% :  Encode completed" OR "SUCCESS : 100% :  (PUSH) completed"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Are you saying that the "Encode" and "Copy Transfer" fields have more than one value each?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 19:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21653#M3577</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T19:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21654#M3578</link>
      <description>&lt;P&gt;why would I add NOT if the encode and copy strings are exactly what I'm trying to get? &lt;/P&gt;

&lt;P&gt;They each have one Task_time field per task_id&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21654#M3578</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2020-09-28T11:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21655#M3579</link>
      <description>&lt;P&gt;You're absolutely right. Take out the NOT.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 20:11:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21655#M3579</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T20:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21656#M3580</link>
      <description>&lt;P&gt;hehe - ok finally that gets me down to the two lines per task_id that I'm looking for. Next is since both the encode and the copy line have a value for Task_time, how do I rename the enocde Task_time field as one thing and the copy as another?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21656#M3580</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2020-09-28T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21657#M3581</link>
      <description>&lt;P&gt;Like in the original answer, you have two choices:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Pick out the fields before the transaction using &lt;CODE&gt;eval Encode=if(searchmatch("Encode completed", Task_time, null())&lt;/CODE&gt; and &lt;CODE&gt;eval Transfer=if(searchmatch("PUSH completed", Task_time, null())&lt;/CODE&gt;. This will leave each transaction with one value for Encode, and one value for Transfer.&lt;/LI&gt;
&lt;LI&gt;After the transaction, slice the multivalued "Task_time" field into two separate values using mvindex.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 08 Apr 2012 20:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21657#M3581</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T20:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21658#M3582</link>
      <description>&lt;P&gt;where do I stick this, which converts milaseconds to HH:MM:SS?&lt;/P&gt;

&lt;P&gt;eval inSec = Task_time / 1000 | fieldformat Task_time = tostring(inSec, "duration")&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21658#M3582</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2020-09-28T11:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21659#M3583</link>
      <description>&lt;P&gt;You can put those at the very end, but you have to do it twice, once for each of the fields "Encode" and "Transfer", not for "Task_time". Also, you can combine the two. For instance, add: &lt;CODE&gt;| fieldformat Encode = tostring(Encode/1000, "duration") | fieldformat Transfer = tostring(Transfer/1000, "duration")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 21:05:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21659#M3583</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-04-08T21:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rename same field different things</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21660#M3584</link>
      <description>&lt;P&gt;keep getting "Error in 'fieldformat' command: Typechecking failed. '/' only takes numbers."&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2012 22:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-same-field-different-things/m-p/21660#M3584</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-08T22:55:36Z</dc:date>
    </item>
  </channel>
</rss>

