use of org.opensearch.dataprepper.logstash.exception.LogstashConfigurationException in project data-prepper by opensearch-project.
the class DateLogstashPluginAttributesMapper method mapCustomAttributes.
@Override
protected void mapCustomAttributes(final List<LogstashAttribute> logstashAttributes, final LogstashAttributesMappings logstashAttributesMappings, final Map<String, Object> pluginSettings) {
final LogstashAttribute matchAttribute = logstashAttributes.stream().filter(logstashAttribute -> logstashAttribute.getAttributeName().equals(LOGSTASH_DATE_MATCH_ATTRIBUTE_NAME)).findFirst().orElseThrow(() -> new LogstashConfigurationException("Missing date match setting in Logstash configuration"));
final DateProcessorConfig.DateMatch matchAttributeConvertedValue = convertMatchAttribute(matchAttribute);
pluginSettings.put(logstashAttributesMappings.getMappedAttributeNames().get(LOGSTASH_DATE_MATCH_ATTRIBUTE_NAME), Collections.singletonList(matchAttributeConvertedValue));
}
Aggregations