# Uninitialize field

**URL:** <https://community.zeek.org/t/uninitialize-field/5284>\
**Category:** Zeek\
**Created:** [May 1, 2018, 1:05pm UTC](https://community.zeek.org/t/uninitialize-field/5284 "2018-05-01T13:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Y](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@John\_Y](https://community.zeek.org/u/John_Y)\
**Post date:** [May 1, 2018, 1:05pm UTC](https://community.zeek.org/t/uninitialize-field/5284/1 "2018-05-01T13:05:03Z")

</div>

Hi!

I am using the connection type to make custom logging.  
How can i check that each of his fields are initialize before i pull them?

Thanking in advance,  
John

---

<div class="post-metadata">

**Author:** ![Jon\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jon\_Siwek](https://community.zeek.org/u/Jon_Siwek)\
**Post date:** [May 1, 2018, 3:11pm UTC](https://community.zeek.org/t/uninitialize-field/5284/2 "2018-05-01T15:11:23Z")

</div>

If you want to check that a single field exists, use the ?$ operator. See [1] for operator docs.

If you want to check that a set of fields exists (e.g. all of them), then you'll either need to individually check them all via the ?$ operator you use the record\_fields() function [2] to introspect whether some set of fields in the record are initialized. I'm guessing the introspection route is overkill for what you need, though just mentioning it for completeness.

- Jon

[1] [https://www.bro.org/sphinx/script-reference/operators.html](https://www.bro.org/sphinx/script-reference/operators.html)  
[2] [https://www.bro.org/sphinx/scripts/base/bif/bro.bif.bro.html?highlight=record\_fields#id-record\_fields](https://www.bro.org/sphinx/scripts/base/bif/bro.bif.bro.html?highlight=record_fields#id-record_fields)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:45pm UTC](https://community.zeek.org/t/uninitialize-field/5284/3 "2022-05-06T15:45:45Z")

</div>


