<?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: simple question on transactions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30582#M6210</link>
    <description>&lt;P&gt;That doesn't seem to work for me. Transaction returns the entry with the renamed field or the eval'd field, but not the unrenamed field.  It's as if the renaming has clobbered something.&lt;/P&gt;

&lt;P&gt;i.e. given &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;b=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | rename a as b | transaction a
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns only &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 Sep 2013 06:56:39 GMT</pubDate>
    <dc:creator>BenAveling</dc:creator>
    <dc:date>2013-09-16T06:56:39Z</dc:date>
    <item>
      <title>simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30580#M6208</link>
      <description>&lt;P&gt;The transaction command works with a common field across logs. how can we group multiple events which might have the same types of values (for eg. sessionid) but under a differnt field name? eg. value a0001 might be sessionid for sourcetype A but might be uid for sourcetype B.. Can this be done via tags/aliases?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 12:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30580#M6208</guid>
      <dc:creator>bessery</dc:creator>
      <dc:date>2013-02-13T12:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30581#M6209</link>
      <description>&lt;P&gt;Either of these would work fine...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{your search criteria} | rename some_field as normalized_field | transaction normalized_field

{your search criteria} | eval normalized_field=some_field | transaction normalized_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The difference between the two - "some_field" will not be available as a distinct field in the first query as it is renamed. The second will create a second field while leaving the original extracted field as part of the event.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 13:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30581#M6209</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2013-02-13T13:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30582#M6210</link>
      <description>&lt;P&gt;That doesn't seem to work for me. Transaction returns the entry with the renamed field or the eval'd field, but not the unrenamed field.  It's as if the renaming has clobbered something.&lt;/P&gt;

&lt;P&gt;i.e. given &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;b=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | rename a as b | transaction a
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns only &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Sep 2013 06:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30582#M6210</guid>
      <dc:creator>BenAveling</dc:creator>
      <dc:date>2013-09-16T06:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30583#M6211</link>
      <description>&lt;P&gt;...but you're renaming a to b, then doing the transaction on a. Don't you want it to be b?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 09:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30583#M6211</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-16T09:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30584#M6212</link>
      <description>&lt;P&gt;Hi Ayn, you're right, I should have been "search b". Cut &amp;amp; paste error in the search, but what I said it returns is correct.&lt;/P&gt;

&lt;P&gt;As written above, it returns nothing.&lt;/P&gt;

&lt;P&gt;Corrected to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search... |  rename a as b | transaction b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it returns:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; a=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It turns out that rename and eval do not merge, they overwrite, with null if 'a' doesn't exist.  &lt;/P&gt;

&lt;P&gt;To get the desired result you need to use something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval a_or_b = if(a!="",a,b) | transaction a_or_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval a_or_b=coalesce(a,b) | transaction a_or_b
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2013 03:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30584#M6212</guid>
      <dc:creator>BenAveling</dc:creator>
      <dc:date>2013-09-17T03:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: simple question on transactions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30585#M6213</link>
      <description>&lt;P&gt;You could use a tag to select all records that have a particular value in different fields, but you'd need to tag and search for all the values you're interested in, and you'd still have the question of how to group the records.&lt;/P&gt;

&lt;P&gt;To get the desired result, probably better to use something like this:&lt;/P&gt;

&lt;P&gt;... | eval id = if(sessionid !="",sessionid ,uid) | transaction id&lt;/P&gt;

&lt;P&gt;or this:&lt;/P&gt;

&lt;P&gt;... | eval id=coalesce(sessionid ,uid) | transaction id&lt;/P&gt;

&lt;P&gt;You can't just use "rename sessionid as uid", or "eval uid=sessionid", because rename and eval would overwrite the original values of uid.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 01:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/simple-question-on-transactions/m-p/30585#M6213</guid>
      <dc:creator>BenAveling</dc:creator>
      <dc:date>2013-09-18T01:16:22Z</dc:date>
    </item>
  </channel>
</rss>

