<?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 failing after join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630397#M219011</link>
    <description>&lt;P&gt;Given example is simplified version of query,&amp;nbsp; however in actual&amp;nbsp;requestId is coming from another dataset&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 06:27:55 GMT</pubDate>
    <dc:creator>rakeshkiit</dc:creator>
    <dc:date>2023-02-10T06:27:55Z</dc:date>
    <item>
      <title>Why is eval failing after join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630391#M219007</link>
      <description>&lt;PRE&gt;index=na160 starttime="02/02/2023:00:00:00" endtime="02/02/2023:24:00:00" requestId="TID:131610985000004c2d"&lt;BR /&gt;|stats count as 240_COUNT by logRecordType&lt;BR /&gt;| join logRecordType type=outer&lt;BR /&gt;[search index=na160 starttime="02/08/2023:00:00:00" endtime="02/08/2023:24:00:00" requestId="TID:348627200000212ea7"&lt;BR /&gt;| stats count as 242_COUNT by logRecordType]&lt;BR /&gt;| eval difference = (242_COUNT - 240_COUNT)&lt;BR /&gt;| table logRecordType, 240_COUNT, 242_COUNT, difference&lt;/PRE&gt;
&lt;P&gt;Above eval fails after joining two dataset&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Error in 'eval' command: The expression is malformed.&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;Appreciate your help here to mitigate this issue.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 20:30:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630391#M219007</guid>
      <dc:creator>rakeshkiit</dc:creator>
      <dc:date>2023-02-10T20:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Eval failing after join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630392#M219008</link>
      <description>&lt;P&gt;On the right hand side of an eval statement if the field name starts with numbers or contains '.' or other non standard characters, you must wrap the field name in single quotes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval difference = ('242_COUNT' - '240_COUNT')&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Feb 2023 05:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630392#M219008</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-10T05:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Eval failing after join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630394#M219009</link>
      <description>&lt;P&gt;Note that using join is not good practice, as it's rarely necessary in Splunk and has limitations, which can give unpredictable results.&lt;/P&gt;&lt;P&gt;You can achieve the same thing using stats&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=na160 (starttime="02/02/2023:00:00:00" endtime="02/02/2023:24:00:00" requestId="TID:131610985000004c2d") OR
            (starttime="02/08/2023:00:00:00" endtime="02/08/2023:24:00:00" requestId="TID:348627200000212ea7")

| stats count(eval(requestId="TID:131610985000004c2d")) as 240_COUNT count(eval(requestId="TID:348627200000212ea7")) as 242_COUNT by logRecordType 
| eval difference = (242_COUNT - 240_COUNT)
| table logRecordType, 240_COUNT, 242_COUNT, difference&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Feb 2023 05:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630394#M219009</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-10T05:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Eval failing after join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630397#M219011</link>
      <description>&lt;P&gt;Given example is simplified version of query,&amp;nbsp; however in actual&amp;nbsp;requestId is coming from another dataset&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 06:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630397#M219011</guid>
      <dc:creator>rakeshkiit</dc:creator>
      <dc:date>2023-02-10T06:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Eval failing after join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630401#M219012</link>
      <description>&lt;P&gt;All good - just it's useful to not start your Splunk life with join - it's really worth getting your head around how to use stats+eval to join data sets. You will not regret it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt; join can often lead you down a miserable path wondering why things don't do what you expect.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 06:46:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-eval-failing-after-join/m-p/630401#M219012</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-10T06:46:33Z</dc:date>
    </item>
  </channel>
</rss>

