public void handleEvent()

in appender/influxdb/src/main/java/org/apache/karaf/decanter/appender/influxdb/InfluxDbAppender.java [118:143]


    public void handleEvent(Event event) {
        if (EventFilter.match(event, config)) {
            String type = "decanter";
            if (event.getProperty("type") != null) {
                type = (String) event.getProperty("type");
            }

            Map<String, Object> eventFields = new HashMap<>();
            Map<String, String> eventTags = new HashMap<>();
            eventTags.putAll(globalTags);

            for (String propertyName : event.getPropertyNames()) {
                Object propertyValue = event.getProperty(propertyName);
                if (propertyValue != null) {
                    if (propertyValue instanceof Number || propertyValue instanceof Boolean) {
                        eventFields.put(propertyName, propertyValue);
                    }
                    else if(propertyValue instanceof String){
                        eventTags.put(propertyName, (String) propertyValue);
                    }
                }
            }
            Point point = Point.measurement(type).fields(eventFields).tag(eventTags).build();
            influxDB.write(point);
        }
    }