I have set up elastic apm for a django project with logging (elasticapm.contrib.django.handlers.LoggingHandler). Upon logging a message as follows:
logger.exception(
custom_logging_message,
exc_info=True,
extra={
'status_code': status_code
},
)
it correctly records the error document, including the extra field status_code under error.custom.status_code, so far so great.
but i cannot use it in a filter (or DSL query), like error.custom.status_code >= 500
is this because the field is not indexed? i tried to find all indexed fields via GET _my_error_index/_mapping?pretty and indeed it is not among the "mappings". how can i use my custom logging data in filters or DSL queries? thank you