context field with Json: { "@timestamp":"2019-04-23T16:33:16.045Z", "context":{"test1":"test1", "test":"test"} }
context field with nonjson: { "@timestamp":"2019-04-23T16:33:16.045Z", "context":["test|test|test|test|test"] }
The context field is a valid JSON object. You can not capture it as a string and rename, as it's already parsed. JSON support in filebeat parses the complete document as is. Reading your config I guess you assume all top-level fields still to be strings. This is not the case.
The regexp.context filter can not succeed, cause regexp condition looks for a string or an array of strings, yet you present it either an object or and array.
Your options are (one of):
Drop the context field, so indexing works
Create an Ingest Node pipeline with painless script to process the events. JSON can be parsed either in Beats or Ingest Node
Enforce some stronger types/schema for the context fields
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.