<?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: Error in 'eval' command: The operator at '{}.Instrument' is invalid. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190649#M54900</link>
    <description>&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Still doesn't work, I think it's related to the level that eval handles events. Any eval events doesn't seem to work on a row basis.&lt;/P&gt;

&lt;P&gt;The source data is JSON and Splunk is extracing the collection.&lt;/P&gt;

&lt;P&gt;[{"Volume": 10, "Instrument": "FTSE100", "Broker": "FTSE", "SequenceItem": "SPOT"}, {"Volume": 20, "Instrument": "FTSE250", "Broker": "LSE", "SequenceItem": "SPOT"}&lt;/P&gt;</description>
    <pubDate>Mon, 24 Aug 2015 14:33:41 GMT</pubDate>
    <dc:creator>TheMilkMan</dc:creator>
    <dc:date>2015-08-24T14:33:41Z</dc:date>
    <item>
      <title>Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190644#M54895</link>
      <description>&lt;P&gt;Do you know why I get the following error message?&lt;/P&gt;

&lt;P&gt;vols{}.Instrument is a valid field but it doesn't like the {}.&lt;/P&gt;

&lt;P&gt;index=gasvol | head 1 | eval Contract=vols{}.Instrument + " " +  vols{}.SequenceItem | rename vols{}.Broker as "Broker" vols{}.Volume as "Volume" | table Broker Contract Volume&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The operator at '{}.Instrument' is invalid.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190644#M54895</guid>
      <dc:creator>TheMilkMan</dc:creator>
      <dc:date>2015-08-21T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190645#M54896</link>
      <description>&lt;P&gt;I suggest you rename the data model, if you can.  Using special characters other than '_' is asking for trouble.&lt;/P&gt;

&lt;P&gt;If you can't rename the model itself, try using the &lt;CODE&gt;rename&lt;/CODE&gt; search command to change "vols{}" to "vols".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gasvol | head 1 | rename "vols{}" as vols | eval Contract=vols.Instrument + " " + vols.SequenceItem | rename vols.Broker as "Broker" vols.Volume as "Volume" | table Broker Contract Volume
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Aug 2015 17:32:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190645#M54896</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-21T17:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190646#M54897</link>
      <description>&lt;P&gt;You go two options here&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Rename so that special characters are removed by the field names&lt;/P&gt;

&lt;P&gt;index=gasvol | head 1  | rename vols{}.* as * | eval Contract=Instrument + " " + SequenceItem | table Broker Contract Volume&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Enclose the fields within single quotes for eval and where commands&lt;/P&gt;

&lt;P&gt;index=gasvol | head 1 | eval Contract='vols{}.Instrument' + " " + 'vols{}.SequenceItem' | rename vols{}.Broker as "Broker" vols{}.Volume as "Volume" | table Broker Contract Volume&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 21 Aug 2015 19:56:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190646#M54897</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-21T19:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190647#M54898</link>
      <description>&lt;P&gt;Thanks both for your help.&lt;/P&gt;

&lt;P&gt;This resolved the problem but when I try to join Instrument and SequenceItem the field is blank. It doesn't seem to structure the results like it does display in the table, if I do min then it gives me a value but not the correct value eval Contract2=min(Instrument)." ".min(SequenceItem).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gasvol | head 1 | rename vols{}.* as * | table Instrument SequenceItem Broker Volume Contract Contract2 | eval Contract=Instrument." ".SequenceItem
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Aug 2015 13:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190647#M54898</guid>
      <dc:creator>TheMilkMan</dc:creator>
      <dc:date>2015-08-24T13:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190648#M54899</link>
      <description>&lt;P&gt;Try rearranging things a little:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gasvol | head 1 | rename vols{}.* as * | eval Contract=Instrument." ".SequenceItem | eval Contract2=min(Instrument)." ".min(SequenceItem) | table Instrument SequenceItem Broker Volume Contract Contract2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Aug 2015 14:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190648#M54899</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-24T14:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190649#M54900</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Still doesn't work, I think it's related to the level that eval handles events. Any eval events doesn't seem to work on a row basis.&lt;/P&gt;

&lt;P&gt;The source data is JSON and Splunk is extracing the collection.&lt;/P&gt;

&lt;P&gt;[{"Volume": 10, "Instrument": "FTSE100", "Broker": "FTSE", "SequenceItem": "SPOT"}, {"Volume": 20, "Instrument": "FTSE250", "Broker": "LSE", "SequenceItem": "SPOT"}&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 14:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190649#M54900</guid>
      <dc:creator>TheMilkMan</dc:creator>
      <dc:date>2015-08-24T14:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The operator at '{}.Instrument' is invalid.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190650#M54901</link>
      <description>&lt;P&gt;I worked it, you need to split the JSON array using spath then use mvexpand to extract the collection.&lt;/P&gt;

&lt;P&gt;index=gasvol | head 1 | spath output=myfield path=vols{} | mvexpand myfield | spath input=myfield | eval Contract=Instrument. " " .SequenceItem | table Contract Broker Volume&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 07:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-operator-at-Instrument-is-invalid/m-p/190650#M54901</guid>
      <dc:creator>TheMilkMan</dc:creator>
      <dc:date>2015-08-25T07:55:09Z</dc:date>
    </item>
  </channel>
</rss>

