Search in sources :

Example 1 with LogstashConfigurationException

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));
}
Also used : LogstashConfigurationException(org.opensearch.dataprepper.logstash.exception.LogstashConfigurationException) LogstashAttribute(org.opensearch.dataprepper.logstash.model.LogstashAttribute) DateProcessorConfig(com.amazon.dataprepper.plugins.processor.date.DateProcessorConfig)

Aggregations

DateProcessorConfig (com.amazon.dataprepper.plugins.processor.date.DateProcessorConfig)1 LogstashConfigurationException (org.opensearch.dataprepper.logstash.exception.LogstashConfigurationException)1 LogstashAttribute (org.opensearch.dataprepper.logstash.model.LogstashAttribute)1