<?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 Calrification on transaction command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158561#M44677</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There is a requirement to group the events that startswith"String1" and endswith "String2" as a transaction OR group the events that startswith="String3" and endswith="String4" in the same search query and extract fields.I tried the search query like as follows&lt;/P&gt;

&lt;P&gt;index=axr |transaction startwith="String1" endswith="String2" OR transaction startswith="String3" endswith="String4" &lt;BR /&gt;
But I get error as there is no option to have two startswith and endswith &lt;/P&gt;

&lt;P&gt;Is there any way available in splunk to accomplish this requirement? Please advise.The sample logs&lt;/P&gt;

&lt;P&gt;20141205::User logged off(String1 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141206::IBMX_fer:failed to ftp(String3 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141207 ::No translation(String4 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141208 ::Processing complete(String2 of transaction)&lt;/P&gt;</description>
    <pubDate>Fri, 09 May 2014 07:57:50 GMT</pubDate>
    <dc:creator>Jananee_iNautix</dc:creator>
    <dc:date>2014-05-09T07:57:50Z</dc:date>
    <item>
      <title>Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158561#M44677</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There is a requirement to group the events that startswith"String1" and endswith "String2" as a transaction OR group the events that startswith="String3" and endswith="String4" in the same search query and extract fields.I tried the search query like as follows&lt;/P&gt;

&lt;P&gt;index=axr |transaction startwith="String1" endswith="String2" OR transaction startswith="String3" endswith="String4" &lt;BR /&gt;
But I get error as there is no option to have two startswith and endswith &lt;/P&gt;

&lt;P&gt;Is there any way available in splunk to accomplish this requirement? Please advise.The sample logs&lt;/P&gt;

&lt;P&gt;20141205::User logged off(String1 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141206::IBMX_fer:failed to ftp(String3 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141207 ::No translation(String4 of transaction)&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
20141208 ::Processing complete(String2 of transaction)&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 07:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158561#M44677</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-09T07:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158562#M44678</link>
      <description>&lt;P&gt;Hi Jananee_iNautix,&lt;/P&gt;

&lt;P&gt;your &lt;CODE&gt;transaction&lt;/CODE&gt; will not work because of the &lt;CODE&gt;startswith="" endswith="" OR startswith="" endswith=""&lt;/CODE&gt; options which are supposed to be provided only once.&lt;/P&gt;

&lt;P&gt;if your events only have either &lt;CODE&gt;string1&lt;/CODE&gt; or &lt;CODE&gt;string3&lt;/CODE&gt; and &lt;CODE&gt;string2&lt;/CODE&gt; or &lt;CODE&gt;string4&lt;/CODE&gt; then you could try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search to get all needed events | eval mystart=coalesce(string1, string3) | eval myend=if(mystart=string1, string2, string4) | transaction startswith=mystart endswith=myend | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some minor updates to the wording and the search command, based on the two comments below &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 09:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158562#M44678</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-09T09:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158563#M44679</link>
      <description>&lt;P&gt;Hello Mus&lt;/P&gt;

&lt;P&gt;In your solution you could end up with start with string 1 and ends with string 4 as a valid transaction. And it seems that string 1 would only ends with string 3 (not 3 or 4)&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 11:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158563#M44679</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2014-05-09T11:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158564#M44680</link>
      <description>&lt;P&gt;that's true, but as long as no log examples are provided this is all just &lt;CODE&gt;if - when - maybe - you - could&lt;/CODE&gt; ... then again one can add another &lt;CODE&gt;if&lt;/CODE&gt; to check &lt;CODE&gt;eval myend=if(mystart=string1, string2, string4)&lt;/CODE&gt; ...&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 12:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158564#M44680</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-09T12:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158565#M44681</link>
      <description>&lt;P&gt;I don't see anything wrong with the initial search of &lt;CODE&gt;index=axr&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 19:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158565#M44681</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-09T19:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158566#M44682</link>
      <description>&lt;P&gt;My requirement is like the transaction should start with "String1" and endwith "String2" strictly and the other transaction should startwith="String3" and endswith="String4" striclty.There should not be other combinations .Can you please suggest any way to do that?&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2014 06:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158566#M44682</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-12T06:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158567#M44683</link>
      <description>&lt;P&gt;If your events only contain either String1 or String3 you can test my search command. it will take either String1 or String3 as startswith and depending on startswith sets either String2 or String4 as endswith&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2014 06:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158567#M44683</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-12T06:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158568#M44684</link>
      <description>&lt;P&gt;When worked with the query given by you,the events of transaction involving String3 &amp;amp; String4 doesn't get load.The transaction -String3 &amp;amp;4 is inside the transaction -String1 &amp;amp;2.In such cases,will the query works as expected.I have also uploaded the sample logs in the question.Please take a look at the logs and advise .&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2014 07:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158568#M44684</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-13T07:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calrification on transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158569#M44685</link>
      <description>&lt;P&gt;Okay, this is way you should always provide some sample logs if asking something....it looks like your string1|2|3|4 is not a field. You really mean a string of words. So first thing to do is, to get those words in some field, because the evals I used are all based on fields called &lt;CODE&gt;string1&lt;/CODE&gt; or &lt;CODE&gt;string2&lt;/CODE&gt; and so on.&lt;/P&gt;

&lt;P&gt;Read more about field extraction here &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;BR /&gt;
and use the new cretaed field as shown in my example.&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2014 09:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calrification-on-transaction-command/m-p/158569#M44685</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-13T09:07:32Z</dc:date>
    </item>
  </channel>
</rss>

