Open gsterin opened 8 years ago
This line https://github.com/awslabs/cloudwatch-logs-subscription-consumer/blob/master/src/main/java/com/amazonaws/services/logs/connectors/elasticsearch/CloudWatchLogsElasticsearchDocument.java#L101 should be returning new JSONObject(ElasticsearchTransformerUtils.extractJson(message));
There was a change here https://github.com/awslabs/cloudwatch-logs-subscription-consumer/commit/9eef3cd025d8725e62c15b72dc80c36417ccf3c8 to support adding JSON extracted fields with a non-JSON prefix. However, it misses the case where there are no extracted fields but still a string with a JSON prefix: https://github.com/awslabs/cloudwatch-logs-subscription-consumer/blob/master/src/main/java/com/amazonaws/services/logs/connectors/elasticsearch/CloudWatchLogsElasticsearchDocument.java#L100
For example, putting a log event with a message:
Fails with the following exception in /var/log/cloudwatch-logs-subscription-consumer.log