<?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: Eval a transaction with conditional statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475512#M133639</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction unifyends=true JobID maxspan=12h | eval duration=round(duration/60, 2) | eval FTPDownload=if(match(_raw, "FTPDownload"), "Yes", "No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval FTPDownload=if(match(_raw, "FTPDownload"), "Yes", null()) | transaction unifyends=true JobID maxspan=12h | eval duration=round(duration/60, 2) | eval FTPDownload=coalesce(FTPDownload,"No")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Sep 2019 18:51:20 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2019-09-11T18:51:20Z</dc:date>
    <item>
      <title>Eval a transaction with conditional statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475511#M133638</link>
      <description>&lt;P&gt;I am using a transaction to group some jobs and get the timings. In doing so I want to check for certain steps, file download steps. I have the following.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| transaction unifyends=true  JobID maxspan=12h &lt;BR /&gt;
| eval duration=round(duration/60, 2)&lt;BR /&gt;
| eval FTPDownload=if(like(_raw, "%FTPDownload%"), "Yes", "No")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In this case I want to check if the transaction itself contains FTPDownload, and set FTPDownload to Yes or No. I am at times getting both Yes and No, for the same job which does not change. Also for jobs I know and see there is an FTPDownload step, I am getting No back. Is _raw in this case only evaluating the first event in the transaction? Is there any issue with this approach I am overlooking? It seems like this should work but the results are not correct.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 17:17:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475511#M133638</guid>
      <dc:creator>aohls</dc:creator>
      <dc:date>2019-09-11T17:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Eval a transaction with conditional statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475512#M133639</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction unifyends=true JobID maxspan=12h | eval duration=round(duration/60, 2) | eval FTPDownload=if(match(_raw, "FTPDownload"), "Yes", "No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval FTPDownload=if(match(_raw, "FTPDownload"), "Yes", null()) | transaction unifyends=true JobID maxspan=12h | eval duration=round(duration/60, 2) | eval FTPDownload=coalesce(FTPDownload,"No")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Sep 2019 18:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475512#M133639</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-09-11T18:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Eval a transaction with conditional statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475513#M133640</link>
      <description>&lt;P&gt;@somesoni2 The first one worked great. I attempted to use match very quickly but must have mistyped something along the way.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 12:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-a-transaction-with-conditional-statement/m-p/475513#M133640</guid>
      <dc:creator>aohls</dc:creator>
      <dc:date>2019-09-12T12:07:47Z</dc:date>
    </item>
  </channel>
</rss>

