Configuration errors
This page provides troubleshooting tips and explanations for errors related to NXLog Agent misconfiguration.
Scheduled execution failed - no or missing record
- Symptom
-
Your configuration uses a Schedule, but it is not running as expected. The log file contains errors similar to the following:
Expression evaluation has been aborted; missing record, no field available in this context
or
Expression evaluation has been aborted; no record available
- Possible reason
-
This issue occurs when you use event-related procedures functions in a Schedule block. For example, the following configuration incorrectly uses the
to_json()
function inside aSchedule
block:<Extension json> Module xm_json </Extension> <Input im_tcp> Module im_tcp <Schedule> Every 5 min <Exec> $$sample = to_json(); log_info($$sample); </Exec> </Schedule> </Input>
This behavior also applies to module functions and procedures that are not directly event-related but could be configured in a way that they are. For example, the following configuration incorrectly uses the
file_name()
function inside aSchedule
block because theFile
directive uses the$Hostname
event field.<Output file> Module om_file File '/var/logs/syslog-' + $Hostname + '.log' <Schedule> Every 10 min <Exec> if file_size(file_name()) >= 100M { file_cycle(file_name(), 2); reopen(); } </Exec> </Schedule> </Output>
- Solution
-
You cannot use event-related procedures or functions in a
Schedule
block. If you do, theSchedule
block execution fails, and NXLog Agent writes an error in its log file. This behavior is as expected. See theSchedule
block Exec directive for more information.