<div><div dir="auto">That worked. Thanks </div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 4, 2019 at 12:19 PM Jon Siwek &lt;<a href="mailto:jsiwek@corelight.com">jsiwek@corelight.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 4, 2019 at 8:59 AM Woot4moo &lt;<a href="mailto:tscheponik@gmail.com" target="_blank">tscheponik@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; How can one reference a potentially missing key such that the script will not terminate? For example in a file_new event, if I reference the mime_type attribute and it is uninitialized I receive “no such field in record”<br>
&gt;<br>
&gt; Example code below:<br>
&gt;<br>
&gt;   if( f?$mime_type) #error here<br>
<br>
That&#39;s the correct way to check for uninitialized &amp;optional values,<br>
but the error here is saying there&#39;s &quot;no such field&quot;, not that the<br>
&quot;field is uninitialized.  i.e. there is no &quot;mime_type&quot; field in the<br>
&quot;fa_file&quot; record type.  You&#39;re probably meaning to access<br>
f$info$mime_type, which gets populated via the &quot;file_sniff&quot; event&#39;s<br>
&quot;fa_metadata&quot; record&#39;s &quot;mime_type&quot; field.<br>
<br>
(You can check if a record contains a field name by using the<br>
&quot;record_fields&quot; function to introspect, but that&#39;s not a typical thing<br>
people do and likely not what you really want).<br>
<br>
- Jon<br>
</blockquote></div></div>