<?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 parsing issue? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416831#M169253</link>
    <description>&lt;P&gt;thanks - that works...  also   | rename CurrentAgentSnapshot.Contacts{}.StartTime as StartTime   works as well (just to share the knowledge)&lt;/P&gt;</description>
    <pubDate>Thu, 24 May 2018 15:56:22 GMT</pubDate>
    <dc:creator>mwibowo1</dc:creator>
    <dc:date>2018-05-24T15:56:22Z</dc:date>
    <item>
      <title>eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416824#M169246</link>
      <description>&lt;P&gt;index=xyz  CurrentAgentSnapshot.Contacts{}.State=ENDED | table CurrentAgentSnapshot.Contacts{}.StartTime    There is no issue with this.&lt;BR /&gt;
but it gives me error when i try to do     eval x = CurrentAgentSnapshot.Contacts{}.StartTime   (the error is Error in 'eval' command: The expression is malformed.)&lt;/P&gt;

&lt;P&gt;I need to do some calculation using eval on some of the variables   CurrentAgentSnapshot.Contacts{}.variables .. such as &lt;BR /&gt;
eval startTime = strptime(CurrentAgentSnapshot.Contacts{}.StartTime, "%Y-%m-%dT%H:%M:%S.%3N") |&lt;BR /&gt;
eval endTime =  strptime(CurrentAgentSnapshot.Contacts{}.EndTime, "%Y-%m-%dT%H:%M:%S.%3N") | &lt;BR /&gt;
eval diff = tostring((endTime - startTime), "duration") &lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 23:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416824#M169246</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-05-23T23:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416825#M169247</link>
      <description>&lt;P&gt;it seems like the eval operation cannot parse the json array {}   .. please help&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 00:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416825#M169247</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-05-24T00:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416826#M169248</link>
      <description>&lt;P&gt;I do not know whether it is a bug or specification&lt;BR /&gt;
It is a workaround.&lt;/P&gt;

&lt;P&gt;Even if you set the field name "{}", "{}" seems to have been deleted, so delete "{}" if you use it with EVAL.&lt;BR /&gt;
Please do not forget to enclose it with a single quotation.&lt;/P&gt;

&lt;P&gt;| makeresults | eval &lt;STRONG&gt;CurrentAgentSnapshot.Contacts{}.StartTime&lt;/STRONG&gt;="2018-05-24T01:02:03.004" &lt;BR /&gt;
| eval startTime = strptime('&lt;STRONG&gt;CurrentAgentSnapshot.Contacts.StartTime&lt;/STRONG&gt;', "%Y-%m-%dT%H:%M:%S.%3N")&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 01:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416826#M169248</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-05-24T01:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416827#M169249</link>
      <description>&lt;P&gt;sorry - i cannot delete the {}  , the data does not show up.   &lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 01:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416827#M169249</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-05-24T01:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416828#M169250</link>
      <description>&lt;P&gt;sorry - the workaround does not work... i try to remove the {} but the result does not show up..&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 01:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416828#M169250</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-05-24T01:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416829#M169251</link>
      <description>&lt;P&gt;Your field names contains special characters (dot, curly braces) so you need to enclose them in single quotes when using it on right side of expressions in eval (or in where clause). Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz CurrentAgentSnapshot.Contacts{}.State=ENDED|
eval startTime = strptime('CurrentAgentSnapshot.Contacts{}.StartTime', "%Y-%m-%dT%H:%M:%S.%3N") |
eval endTime = strptime('CurrentAgentSnapshot.Contacts{}.EndTime', "%Y-%m-%dT%H:%M:%S.%3N") | 
eval diff = tostring((endTime - startTime), "duration") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 04:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416829#M169251</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-24T04:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416830#M169252</link>
      <description>&lt;P&gt;I fixed the answer. Instead of deleting from the field name, delete it when using it with EVAL.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 04:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416830#M169252</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-05-24T04:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: eval parsing issue?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416831#M169253</link>
      <description>&lt;P&gt;thanks - that works...  also   | rename CurrentAgentSnapshot.Contacts{}.StartTime as StartTime   works as well (just to share the knowledge)&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 15:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-parsing-issue/m-p/416831#M169253</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-05-24T15:56:22Z</dc:date>
    </item>
  </channel>
</rss>

