Merge pull request #243 from jbonofre/KARAF-7016
[KARAF-7016] Upgrade to Jetty 9.4.36.v20210114
diff --git a/appender/hdfs/NOTICE b/appender/hdfs/NOTICE
new file mode 100644
index 0000000..4e4af9e
--- /dev/null
+++ b/appender/hdfs/NOTICE
@@ -0,0 +1,57 @@
+Apache Karaf Decanter
+Copyright 2015-2019 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Elastic (https://www.elastic.co/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+OrientDB (http://orientdb.com).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product uses software developed at
+JUnit (http://www.junit.org/).
+Licensed under the Eclipse Public License 1.0.
+
+This product uses software developed at
+Redis (http://www.redis.io).
+Licensed under the BSD license.
+
+This product uses software developed at
+Dropwizard (http://www.dropwizard.io).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+searchbox.io (https://github.com/searchbox-io)
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+MongoDB (https://www.mongodb.com/)
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
+- MIT License
+- Eclipse Public License 1.0
+- BSD License
diff --git a/appender/hdfs/pom.xml b/appender/hdfs/pom.xml
new file mode 100644
index 0000000..82e56d2
--- /dev/null
+++ b/appender/hdfs/pom.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>appender</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.hdfs</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Karaf :: Decanter :: Appender :: HDFS</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client</artifactId>
+ <version>3.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>org.apache.karaf.decanter.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.utils</artifactId>
+ </dependency>
+
+ <!-- test -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter.marshaller</groupId>
+ <artifactId>org.apache.karaf.decanter.marshaller.csv</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <obrRepository>NONE</obrRepository>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>!*</Export-Package>
+ <Import-Package>
+ !org.apache.hadoop*,
+ !com.ctc.wstx*,
+ !com.google.common*,
+ !com.google.appengine*,
+ !com.google.apphosting*,
+ !com.google.errorprone*,
+ !com.google.gson*,
+ !com.google.inject*,
+ !com.google.protobuf*,
+ !com.google.re2j*,
+ !com.google.thirdparty*,
+ !com.ibm.security*,
+ !com.jcraft.jsch,
+ !com.nimbusds*,
+ !com.google.crypto*,
+ !okio*,
+ !com.squareup.okhttp*,
+ !jdiff,
+ !net.jcip*,
+ !net.minidev*,
+ !org.apache.commons.codec*,
+ !org.apache.commons.collections*,
+ !org.apache.commons.configuration2*,
+ !org.apache.commons.compress*,
+ !org.apache.commons.beanutils*,
+ !org.apache.commons.io*,
+ !org.apache.commons.jexl2*,
+ !org.apache.commons.jxpath*,
+ !org.apache.commons.lang3*,
+ !org.apache.commons.math3*,
+ !org.apache.commons.net*,
+ !org.apache.commons.text*,
+ !org.apache.xml*,
+ !org.apache.zookeeper*,
+ !org.tukaani*,
+ android*;resolution:=optional,
+ com.android*;resolution:=optional,
+ com.sun.javadoc;resolution:=optional,
+ com.sun.jersey*;resolution:=optional,
+ com.sun*;resolution:=optional,
+ javax.annotation;resolution:=optional,
+ javax.servlet*;resolution:=optional,
+ javax.ws.rs*;resolution:=optional,
+ org.apache.avro*;resolution:=optional,
+ org.apache.commons.cli*;resolution:=optional,
+ com.github.luben*;resolution:=optional,
+ javax.mail*;resolution:=optional,
+ org.apache.commons.vfs2*;resolution:=optional,
+ org.apache.curator*;resolution:=optional,
+ org.apache.harmony*;resolution:=optional,
+ org.apache.htrace*;resolution:=optional,
+ org.apache.http*;resolution:=optional,
+ org.apache.kerby*;resolution:=optional,
+ org.bouncycastle*;resolution:=optional,
+ org.brotli*;resolution:=optional,
+ org.checkerframework*;resolution:=optional,
+ org.codehaus.jackson*;resolution:=optional,
+ org.codehaus.jettison*;resolution:=optional,
+ org.codehaus.stax2*;resolution:=optional,
+ org.eclipse.jetty*;resolution:=optional,
+ org.jline*;resolution:=optional,
+ org.objectweb.asm*;resolution:=optional,
+ org.relaxng*;resolution:=optional,
+ org.slf4j*;resolution:=optional,
+ org.springframework*;resolution:=optional,
+ org.wildfly*;resolution:=optional,
+ org.xbill*;resolution:=optional,
+ sun*;resolution:=optional,
+ com.fasterxml.jackson.jaxrs*;resolution:=optional,
+ com.fasterxml.jackson.module.jaxb;resolution:=optional,
+ *
+ </Import-Package>
+ <Private-Package>
+ org.apache.karaf.decanter.appender.hdfs,
+ org.apache.karaf.decanter.appender.utils,
+ org.apache.hadoop*,
+ com.ctc.wstx*,
+ com.google.common*,
+ com.google.appengine*,
+ com.google.apphosting*,
+ com.google.errorprone*,
+ com.google.gson*,
+ com.google.inject*,
+ com.google.protobuf*,
+ com.google.re2j*,
+ com.google.thirdparty*,
+ com.ibm.security*,
+ com.jcraft.jsch,
+ com.nimbusds*,
+ com.google.crypto*,
+ okio*,
+ com.squareup.okhttp*,
+ jdiff,
+ net.jcip*,
+ net.minidev*,
+ org.apache.commons.codec*,
+ org.apache.commons.collections*,
+ org.apache.commons.configuration2*,
+ org.apache.commons.compress*,
+ org.apache.commons.beanutils*,
+ org.apache.commons.io*,
+ org.apache.commons.jexl2*,
+ org.apache.commons.jxpath*,
+ org.apache.commons.lang3*,
+ org.apache.commons.math3*,
+ org.apache.commons.net*,
+ org.apache.commons.text*,
+ org.apache.xml.resolver*,
+ org.apache.zookeeper*,
+ org.tukaani*
+ </Private-Package>
+ <_dsannotations>*</_dsannotations>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>src/main/cfg/org.apache.karaf.decanter.appender.hdfs.cfg</file>
+ <type>cfg</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/appender/hdfs/src/main/cfg/org.apache.karaf.decanter.appender.hdfs.cfg b/appender/hdfs/src/main/cfg/org.apache.karaf.decanter.appender.hdfs.cfg
new file mode 100644
index 0000000..85be554
--- /dev/null
+++ b/appender/hdfs/src/main/cfg/org.apache.karaf.decanter.appender.hdfs.cfg
@@ -0,0 +1,34 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+######################################
+# Decanter HDFS Appender Configuration
+######################################
+
+# Optional HDFS configuration
+#hdfs.configuration=
+
+# File mode (create or append)
+#hdfs.mode=create|append|overwrite
+
+# Path location
+#hdfs.path=
+
+# Marshaller
+marshaller.target=(dataFormat=csv)
diff --git a/appender/hdfs/src/main/java/org/apache/karaf/decanter/appender/hdfs/HdfsAppender.java b/appender/hdfs/src/main/java/org/apache/karaf/decanter/appender/hdfs/HdfsAppender.java
new file mode 100644
index 0000000..4ae0cef
--- /dev/null
+++ b/appender/hdfs/src/main/java/org/apache/karaf/decanter/appender/hdfs/HdfsAppender.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.decanter.appender.hdfs;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.karaf.decanter.api.marshaller.Marshaller;
+import org.apache.karaf.decanter.appender.utils.EventFilter;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Dictionary;
+
+@Component(
+ name = "org.apache.karaf.decanter.appender.hdfs",
+ immediate = true,
+ property = EventConstants.EVENT_TOPIC + "=decanter/collect/*"
+)
+public class HdfsAppender implements EventHandler {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(HdfsAppender.class);
+
+ private Dictionary<String, Object> config;
+ private Configuration configuration;
+
+ @Activate
+ public void activate(ComponentContext componentContext) {
+ activate(componentContext.getProperties());
+ }
+
+ public void activate(Dictionary<String, Object> config) {
+ this.config = config;
+ configuration = new Configuration();
+ if (config.get("hdfs.configuration") != null) {
+ configuration.addResource((String) config.get("hdfs.configuration"));
+ }
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ try {
+ if (EventFilter.match(event, config)) {
+ FileSystem fileSystem = FileSystem.get(configuration);
+ if (config.get("hdfs.path") == null) {
+ throw new IllegalArgumentException("hdfs.path is not set");
+ }
+ Path path = new Path((String) config.get("hdfs.path"));
+ FSDataOutputStream outputStream;
+ if (config.get("hdfs.mode") == null) {
+ outputStream = fileSystem.create(path, true);
+ } else {
+ if (((String) config.get("hdfs.mode")).equalsIgnoreCase("append")) {
+ outputStream = fileSystem.append(path);
+ } else if (((String) config.get("hdfs.mode")).equalsIgnoreCase("overwrite")) {
+ outputStream = fileSystem.create(path, true);
+ } else {
+ outputStream = fileSystem.create(path, false);
+ }
+ }
+ try {
+ String marshalled = marshaller.marshal(event);
+ outputStream.writeChars(marshalled);
+ } catch (Exception e) {
+ // nothing to do
+ }
+ outputStream.flush();
+ outputStream.close();
+ fileSystem.close();
+ }
+ } catch (Exception e) {
+ LOGGER.warn("Can't write on HDFS", e);
+ }
+ }
+
+ @Reference
+ public Marshaller marshaller;
+
+}
diff --git a/appender/hdfs/src/test/java/org/apache/karaf/decanter/appender/hdfs/TestHdfsAppender.java b/appender/hdfs/src/test/java/org/apache/karaf/decanter/appender/hdfs/TestHdfsAppender.java
new file mode 100644
index 0000000..f53f0a1
--- /dev/null
+++ b/appender/hdfs/src/test/java/org/apache/karaf/decanter/appender/hdfs/TestHdfsAppender.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.decanter.appender.hdfs;
+
+import org.apache.karaf.decanter.marshaller.csv.CsvMarshaller;
+import org.junit.Assert;
+import org.junit.Test;
+import org.osgi.service.event.Event;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Hashtable;
+
+public class TestHdfsAppender {
+
+ @Test
+ public void testCreate() throws Exception {
+ HdfsAppender appender = new HdfsAppender();
+ appender.marshaller = new CsvMarshaller();
+ Hashtable<String, Object> config = new Hashtable<>();
+ config.put("hdfs.path", "target/hdfs/create");
+ config.put("hdfs.mode", "create");
+ appender.activate(config);
+ HashMap<String, Object> data = new HashMap<>();
+ data.put("foo", "bar");
+ data.put("metric", 10);
+ Event event = new Event("decanter/collect/create", data);
+ appender.handleEvent(event);
+
+ File file = new File("target/hdfs/create");
+ Assert.assertTrue(file.exists());
+ }
+
+}
diff --git a/appender/loki/NOTICE b/appender/loki/NOTICE
new file mode 100644
index 0000000..4e4af9e
--- /dev/null
+++ b/appender/loki/NOTICE
@@ -0,0 +1,57 @@
+Apache Karaf Decanter
+Copyright 2015-2019 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Elastic (https://www.elastic.co/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+OrientDB (http://orientdb.com).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product uses software developed at
+JUnit (http://www.junit.org/).
+Licensed under the Eclipse Public License 1.0.
+
+This product uses software developed at
+Redis (http://www.redis.io).
+Licensed under the BSD license.
+
+This product uses software developed at
+Dropwizard (http://www.dropwizard.io).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+searchbox.io (https://github.com/searchbox-io)
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+MongoDB (https://www.mongodb.com/)
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
+- MIT License
+- Eclipse Public License 1.0
+- BSD License
diff --git a/appender/loki/pom.xml b/appender/loki/pom.xml
new file mode 100644
index 0000000..d603dc8
--- /dev/null
+++ b/appender/loki/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>appender</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.loki</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Karaf :: Decanter :: Appender :: Loki</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>org.apache.karaf.decanter.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.utils</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <obrRepository>NONE</obrRepository>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>!*</Export-Package>
+ <Import-Package>*</Import-Package>
+ <Private-Package>
+ org.apache.karaf.decanter.appender.loki,
+ org.apache.karaf.decanter.appender.utils
+ </Private-Package>
+ <_dsannotations>*</_dsannotations>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>src/main/cfg/org.apache.karaf.decanter.appender.loki.cfg</file>
+ <type>cfg</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/appender/loki/src/main/cfg/org.apache.karaf.decanter.appender.loki.cfg b/appender/loki/src/main/cfg/org.apache.karaf.decanter.appender.loki.cfg
new file mode 100644
index 0000000..1e21de7
--- /dev/null
+++ b/appender/loki/src/main/cfg/org.apache.karaf.decanter.appender.loki.cfg
@@ -0,0 +1,35 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+######################################
+# Decanter Loki Appender Configuration
+######################################
+
+# Loki push API location
+#loki.url=http://localhost:3100/loki/api/v1/push
+
+# Loki tenant
+#loki.tenant=my-tenant
+
+# Loki basic authentication
+#loki.username=
+#loki.password=
+
+# Marshaller
+#marshaller.target=(dataFormat=raw)
\ No newline at end of file
diff --git a/appender/loki/src/main/java/org/apache/karaf/decanter/appender/loki/LokiAppender.java b/appender/loki/src/main/java/org/apache/karaf/decanter/appender/loki/LokiAppender.java
new file mode 100644
index 0000000..58c1bba
--- /dev/null
+++ b/appender/loki/src/main/java/org/apache/karaf/decanter/appender/loki/LokiAppender.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.decanter.appender.loki;
+
+import org.apache.karaf.decanter.api.marshaller.Marshaller;
+import org.apache.karaf.decanter.appender.utils.EventFilter;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedWriter;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.Dictionary;
+
+@Component(
+ name = "org.apache.karaf.decanter.appender.loki",
+ immediate = true,
+ property = EventConstants.EVENT_TOPIC + "=decanter/collect/*"
+)
+public class LokiAppender implements EventHandler {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(LokiAppender.class);
+
+ @Reference(cardinality = ReferenceCardinality.OPTIONAL)
+ public Marshaller marshaller;
+
+ private String url;
+ private String tenant = null;
+ private String username = null;
+ private String password = null;
+ private Dictionary<String, Object> config;
+
+ @Activate
+ public void activate(ComponentContext componentContext) {
+ activate(componentContext.getProperties());
+ }
+
+ public void activate(Dictionary<String, Object> config) {
+ this.config = config;
+ url = (config.get("loki.url") != null) ? (String) config.get("loki.url") : "http://localhost:3100/loki/api/v1/push";
+ tenant = (config.get("loki.tenant") != null) ? (String) config.get("loki.tenant") : null;
+ username = (config.get("loki.username") != null) ? (String) config.get("loki.username") : null;
+ password = (config.get("loki.password") != null) ? (String) config.get("loki.password") : null;
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ if (EventFilter.match(event, config)) {
+ String log;
+ if (marshaller != null) {
+ log = marshaller.marshal(event);
+ } else {
+ StringBuilder builder = new StringBuilder();
+ for (String innerKey : event.getPropertyNames()) {
+ builder.append(innerKey).append(":").append(toString(event.getProperty(innerKey))).append(" | ");
+ }
+ log = builder.toString();
+ }
+ try {
+ HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
+ connection.setDoOutput(true);
+ connection.setRequestMethod("POST");
+ connection.setRequestProperty("Content-Type", "application/json");
+ if (tenant != null) {
+ connection.setRequestProperty("X-Scope-OrgId", tenant);
+ }
+ if (username != null) {
+ String authentication = username + ":" + password;
+ byte[] encodedAuthentication = Base64.getEncoder().encode(authentication.getBytes(StandardCharsets.UTF_8));
+ String authenticationHeader = "Basic " + new String(encodedAuthentication);
+ connection.setRequestProperty("Authorization", authenticationHeader);
+ }
+ String jsonPush = "{\"streams\": [{ \"stream\": { \"job\": \"decanter\" }, \"values\": [ [ \"" + System.currentTimeMillis() * 1000L * 1000L + "\", \"" + log + "\" ] ] }]}";
+ try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))) {
+ writer.write(jsonPush);
+ writer.flush();
+ }
+ if (connection.getResponseCode() != 204) {
+ LOGGER.warn("Can't push to Loki ({}): {}", connection.getResponseCode(), connection.getResponseMessage());
+ }
+ } catch (Exception e) {
+ LOGGER.warn("Error occurred while pushing to Loki", e);
+ }
+ }
+ }
+
+ private Object toString(Object value) {
+ return value == null ? null : value.toString();
+ }
+
+}
diff --git a/appender/orientdb/pom.xml b/appender/orientdb/pom.xml
index 2949993..fd3e6ae 100644
--- a/appender/orientdb/pom.xml
+++ b/appender/orientdb/pom.xml
@@ -45,7 +45,7 @@
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-client</artifactId>
- <version>3.1.5</version>
+ <version>3.1.7</version>
</dependency>
<!-- test -->
diff --git a/appender/pom.xml b/appender/pom.xml
index 1d43b67..4696870 100644
--- a/appender/pom.xml
+++ b/appender/pom.xml
@@ -39,18 +39,21 @@
<module>cassandra</module>
<module>dropwizard</module>
<module>elasticsearch</module>
+ <module>hdfs</module>
<module>file</module>
<module>influxdb</module>
<module>jdbc</module>
<module>jms</module>
<module>kafka</module>
<module>log</module>
+ <module>loki</module>
<module>orientdb</module>
<module>mongodb</module>
<module>mqtt</module>
<module>prometheus</module>
<module>redis</module>
<module>rest</module>
+ <module>s3</module>
<module>socket</module>
<module>timescaledb</module>
<module>websocket-servlet</module>
diff --git a/appender/redis/pom.xml b/appender/redis/pom.xml
index 975340b..b4b8fef 100644
--- a/appender/redis/pom.xml
+++ b/appender/redis/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
- <version>3.14.0</version>
+ <version>3.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.decanter.appender</groupId>
diff --git a/appender/rest/pom.xml b/appender/rest/pom.xml
index 18e29cc..84a080d 100644
--- a/appender/rest/pom.xml
+++ b/appender/rest/pom.xml
@@ -34,7 +34,7 @@
<name>Apache Karaf :: Decanter :: Appender :: REST</name>
<properties>
- <cxf.version>3.4.1</cxf.version>
+ <cxf.version>3.4.2</cxf.version>
</properties>
<dependencies>
diff --git a/appender/s3/NOTICE b/appender/s3/NOTICE
new file mode 100644
index 0000000..4e4af9e
--- /dev/null
+++ b/appender/s3/NOTICE
@@ -0,0 +1,57 @@
+Apache Karaf Decanter
+Copyright 2015-2019 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Elastic (https://www.elastic.co/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+OrientDB (http://orientdb.com).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product uses software developed at
+JUnit (http://www.junit.org/).
+Licensed under the Eclipse Public License 1.0.
+
+This product uses software developed at
+Redis (http://www.redis.io).
+Licensed under the BSD license.
+
+This product uses software developed at
+Dropwizard (http://www.dropwizard.io).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+searchbox.io (https://github.com/searchbox-io)
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+MongoDB (https://www.mongodb.com/)
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
+- MIT License
+- Eclipse Public License 1.0
+- BSD License
diff --git a/appender/s3/pom.xml b/appender/s3/pom.xml
new file mode 100644
index 0000000..50ece1a
--- /dev/null
+++ b/appender/s3/pom.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>appender</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.s3</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Karaf :: Decanter :: Appender :: AWS S3</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-bom</artifactId>
+ <version>1.11.837</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-sts</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-iam</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-kms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter</groupId>
+ <artifactId>org.apache.karaf.decanter.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter.appender</groupId>
+ <artifactId>org.apache.karaf.decanter.appender.utils</artifactId>
+ </dependency>
+
+ <!-- test -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.decanter.marshaller</groupId>
+ <artifactId>org.apache.karaf.decanter.marshaller.csv</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <inherited>true</inherited>
+ <extensions>true</extensions>
+ <configuration>
+ <obrRepository>NONE</obrRepository>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>!*</Export-Package>
+ <Import-Package>
+ !com.amazonaws*,
+ !software.amazon*,
+ !org.apache.http*,
+ !org.joda*,
+ 8org.apache.commons.codec*,
+ com.sun*;resolution:=optional,
+ kotlin*;resolution:=optional,
+ org.bouncycastle*;resolution:=optional,
+ *
+ </Import-Package>
+ <Private-Package>
+ org.apache.karaf.decanter.appender.s3,
+ org.apache.karaf.decanter.appender.utils,
+ com.amazonaws*,
+ software.amazon*,
+ org.apache.http*,
+ org.apache.commons.codec*,
+ org.joda*
+ </Private-Package>
+ <_dsannotations>*</_dsannotations>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>src/main/cfg/org.apache.karaf.decanter.appender.s3.cfg</file>
+ <type>cfg</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/appender/s3/src/main/cfg/org.apache.karaf.decanter.appender.s3.cfg b/appender/s3/src/main/cfg/org.apache.karaf.decanter.appender.s3.cfg
new file mode 100644
index 0000000..efaea65
--- /dev/null
+++ b/appender/s3/src/main/cfg/org.apache.karaf.decanter.appender.s3.cfg
@@ -0,0 +1,36 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+###############################
+# Decanter Appender S3 Configuration
+###############################
+
+# AWS credentials
+accessKeyId=
+secretKeyId=
+
+# AWS Region (optional)
+#region=
+
+# S3 bucket name
+bucket=
+
+
+# Marshaller to use
+marshaller.target=(dataFormat=json)
diff --git a/appender/s3/src/main/java/org/apache/karaf/decanter/appender/s3/S3Appender.java b/appender/s3/src/main/java/org/apache/karaf/decanter/appender/s3/S3Appender.java
new file mode 100644
index 0000000..b2a41f7
--- /dev/null
+++ b/appender/s3/src/main/java/org/apache/karaf/decanter/appender/s3/S3Appender.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.decanter.appender.s3;
+
+import com.amazonaws.auth.AWSStaticCredentialsProvider;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.regions.Regions;
+import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.AmazonS3ClientBuilder;
+import org.apache.karaf.decanter.api.marshaller.Marshaller;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Dictionary;
+import java.util.UUID;
+
+@Component(
+ name = "org.apache.karaf.decanter.appender.s3",
+ immediate = true,
+ property = EventConstants.EVENT_TOPIC + "=decanter/collect/*"
+)
+public class S3Appender implements EventHandler {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(S3Appender.class);
+
+ private Regions regions;
+ private String accessKeyId;
+ private String secretKeyId;
+ private String bucket;
+
+ @Activate
+ public void activate(ComponentContext componentContext) {
+ activate(componentContext.getProperties());
+ }
+
+ public void activate(Dictionary<String, Object> config) {
+ if (config.get("accessKeyId") == null) {
+ throw new IllegalStateException("accessKeyId is not set");
+ }
+ accessKeyId = (String) config.get("accessKeyId");
+ if (config.get("secretKeyId") == null) {
+ throw new IllegalStateException("secretKeyId is not set");
+ }
+ secretKeyId = (String) config.get("secretKeyId");
+ if (config.get("bucket") == null) {
+ throw new IllegalStateException("bucket is not set");
+ }
+ bucket = (String) config.get("bucket");
+ regions = (config.get("region") != null) ? Regions.fromName((String) config.get("region")) : Regions.DEFAULT_REGION;
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKeyId, secretKeyId);
+ AmazonS3 s3 = AmazonS3ClientBuilder.standard()
+ .withRegion(regions)
+ .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
+ .build();
+ String key = "decanter-" + System.currentTimeMillis() + "-" + UUID.randomUUID().toString();
+ s3.putObject(bucket, key, marshaller.marshal(event));
+ }
+
+ @Reference
+ public Marshaller marshaller;
+
+}
diff --git a/assembly/src/main/feature/feature.xml b/assembly/src/main/feature/feature.xml
index 8302043..d70d09a 100644
--- a/assembly/src/main/feature/feature.xml
+++ b/assembly/src/main/feature/feature.xml
@@ -384,6 +384,25 @@
<feature>decanter-appender-cassandra-core</feature>
</feature>
+ <feature name="decanter-appender-hdfs" version="${project.version}" description="Karaf Decanter HDFS appender">
+ <feature>decanter-common</feature>
+ <configfile finalname="/etc/org.apache.karaf.decanter.appender.hdfs.cfg">mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.hdfs/${project.version}</configfile>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.12.0</bundle>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.12.0</bundle>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.12.0</bundle>
+ <bundle>mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.hdfs/${project.version}</bundle>
+ </feature>
+
+ <feature name="decanter-appender-s3" version="${project.version}" description="Karaf Decanter AWS S3 appender">
+ <feature>decanter-common</feature>
+ <configfile finalname="/etc/org.apache.karaf.decanter.appender.s3.cfg">mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.s3/${project.version}</configfile>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.12.0</bundle>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.12.0</bundle>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.12.0</bundle>
+ <bundle dependency="true">mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.12.0</bundle>
+ <bundle>mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.s3/${project.version}</bundle>
+ </feature>
+
<feature name="decanter-appender-redis-core" version="${project.version}" description="Karaf Decanter Redis Appender core">
<feature>decanter-common</feature>
<bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.12.0</bundle>
@@ -468,13 +487,19 @@
<bundle>mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.websocket-servlet/${project.version}</bundle>
</feature>
- <feature name="decanter-appender-prometheus" version="${project.Version}" description="Karaf Decanter Prometheus Servlet Appender">
+ <feature name="decanter-appender-prometheus" version="${project.version}" description="Karaf Decanter Prometheus Servlet Appender">
<feature>decanter-common</feature>
<feature>http</feature>
<configfile finalname="/etc/org.apache.karaf.decanter.appender.prometheus.cfg">mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.prometheus/${project.version}/cfg</configfile>
<bundle>mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.prometheus/${project.version}</bundle>
</feature>
+ <feature name="decanter-appender-loki" version="${project.version}" description="Karaf Decanter Loki appender">
+ <feature>decanter-common</feature>
+ <configfile finalname="/etc/org.apache.karaf.decanter.appender.loki.cfg">mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.loki/${project.version}/cfg</configfile>
+ <bundle>mvn:org.apache.karaf.decanter.appender/org.apache.karaf.decanter.appender.loki/${project.version}</bundle>
+ </feature>
+
<feature name="decanter-processor-passthrough" version="${project.version}" description="Karaf Decanter Pass Through Processor">
<feature>decanter-common</feature>
<bundle>mvn:org.apache.karaf.decanter.processor/org.apache.karaf.decanter.processor.passthrough/${project.version}</bundle>
diff --git a/collector/redis/pom.xml b/collector/redis/pom.xml
index 07c40c6..1b9167e 100644
--- a/collector/redis/pom.xml
+++ b/collector/redis/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
- <version>3.14.0</version>
+ <version>3.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.decanter.collector</groupId>
diff --git a/collector/rest/pom.xml b/collector/rest/pom.xml
index ea4bf4d..84c2ca3 100644
--- a/collector/rest/pom.xml
+++ b/collector/rest/pom.xml
@@ -34,7 +34,7 @@
<name>Apache Karaf :: Decanter :: Collector :: REST</name>
<properties>
- <cxf.version>3.4.1</cxf.version>
+ <cxf.version>3.4.2</cxf.version>
</properties>
<dependencies>
diff --git a/collector/soap/pom.xml b/collector/soap/pom.xml
index 22f5dab..1c3990d 100644
--- a/collector/soap/pom.xml
+++ b/collector/soap/pom.xml
@@ -34,7 +34,7 @@
<name>Apache Karaf :: Decanter :: Collector :: SOAP</name>
<properties>
- <cxf.version>3.4.1</cxf.version>
+ <cxf.version>3.4.2</cxf.version>
</properties>
<dependencies>
diff --git a/manual/src/main/asciidoc/user-guide/appenders.adoc b/manual/src/main/asciidoc/user-guide/appenders.adoc
index 739962b..488543f 100644
--- a/manual/src/main/asciidoc/user-guide/appenders.adoc
+++ b/manual/src/main/asciidoc/user-guide/appenders.adoc
@@ -321,6 +321,44 @@
It's also possible to enable SSL security (with Kafka 0.9.x) using the SSL properties.
+==== Loki
+
+Loki (https://grafana.com/oss/loki/) is a log aggregation system. The Decanter Loki appender is able to push collected data
+to Loki via the Push API.
+
+The Decanter Loki appender converts any kind of collected data (coming from the dispatcher) as a log string that can be stored in Loki.
+
+The `decanter-appender-loki` feature installs the Loki appender:
+
+----
+karaf@root()> feature:install decanter-appender-loki
+----
+
+This feature also adds `etc/org.apache.karaf.decanter.appender.loki.cfg` configuration file:
+
+----
+######################################
+# Decanter Loki Appender Configuration
+######################################
+
+# Loki push API location
+#loki.url=http://localhost:3100/loki/api/v1/push
+
+# Loki tenant
+#loki.tenant=my-tenant
+
+# Loki basic authentication
+#loki.username=
+#loki.password=
+
+# Marshaller
+#marshaller.target=(dataFormat=raw)
+----
+
+* `loki.url` is the location of the Loki push API
+* `loki.tenant` is optional and define the tenant used to push data
+* `loki.username` and `loki.password` are used for basic authentication
+
==== Redis
The Decanter Redis appender sends the data (collected by the collectors) to a Redis broker.
@@ -863,3 +901,75 @@
* `charset` is the message encoding (default is `utf-8`)
* `header.` allows you to add any custom HTTP headers (parameters) to the request (prefixed by `header.`)
* `payload.header` allows you to use a HTTP header to send the collected data instead of directly the "body".
+
+==== HDFS
+
+Decanter HDFS appender stores collected data into a HDFS file.
+
+The `decanter-appender-hdfs` feature installs the HDFS appender:
+
+```
+karaf@root()> feature:install decanter-appender-hdfs
+```
+
+The feature also installs `etc/org.apache.karaf.decanter.appender.hdfs.cfg` configuration file:
+
+----
+######################################
+# Decanter HDFS Appender Configuration
+######################################
+
+# Optional HDFS configuration
+#hdfs.configuration=
+
+# File mode (create or append)
+#hdfs.mode=create|append|overwrite
+
+# Path location
+#hdfs.path=
+
+# Marshaller
+marshaller.target=(dataFormat=csv)
+
+----
+
+* `hdfs.configuration` is the location of the hdfs configuration file (core or site)
+* `hdfs.mode` defines the way of populating the file on HDFS (creating a new one, appending to an existing one, overwriting an existing one)
+* `hdfs.path` defines the location and name of the file on HDFS
+
+==== Amazon S3
+
+Decanter Amazon S3 appender stores collected data as objects in a S3 bucket.
+
+The `decanter-appender-s3` feature installs the S3 appender:
+
+----
+karaf@root()> feature:install decanter-appender-s3
+----
+
+The feature also installs `etc/org.apache.karaf.decanter.appender.hdfs.cfg` configuration file:
+
+----
+###############################
+# Decanter Appender S3 Configuration
+###############################
+
+# AWS credentials
+accessKeyId=
+secretKeyId=
+
+# AWS Region (optional)
+#region=
+
+# S3 bucket name
+bucket=
+
+
+# Marshaller to use
+marshaller.target=(dataFormat=json)
+----
+
+* `accessKeyId` property is required, containing your AWS access key
+* `secretKeyId` property is required, containing your AWS secret key
+* `region` property is optional and allows you to define the Amazon region to use
+* `bucket` property is required, containing the name of the S3 bucket where to add objects
\ No newline at end of file