-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Graylog 2.4.0 and add more MQTT inputs
- Loading branch information
Jochen Schalanda
committed
Jul 12, 2018
1 parent
437d758
commit e5bfa8b
Showing
12 changed files
with
204 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<prerequisites> | ||
<maven>3.0</maven> | ||
</prerequisites> | ||
|
||
<groupId>org.graylog.plugins</groupId> | ||
<parent> | ||
<groupId>org.graylog.plugins</groupId> | ||
<artifactId>graylog-plugin-parent</artifactId> | ||
<version>2.4.0</version> | ||
</parent> | ||
|
||
<artifactId>graylog-plugin-mqtt</artifactId> | ||
<version>1.2.0-SNAPSHOT</version> | ||
|
||
|
@@ -19,150 +21,103 @@ | |
</organization> | ||
|
||
<scm> | ||
<connection>scm:git:[email protected]:Graylog2/graylog-plugin-mqtt.git</connection> | ||
<developerConnection>scm:git:[email protected]:Graylog2/graylog-plugin-mqtt.git</developerConnection> | ||
<url>https://github.com/Graylog2/graylog-plugin-mqtt</url> | ||
<connection>scm:git:[email protected]:graylog-labs/graylog-plugin-mqtt.git</connection> | ||
<developerConnection>scm:git:[email protected]:graylog-labs/graylog-plugin-mqtt.git</developerConnection> | ||
<url>https://github.com/graylog-labs/graylog-plugin-mqtt</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.source.skip>true</maven.source.skip> | ||
<maven.javadoc.skip>true</maven.javadoc.skip> | ||
<maven.install.skip>true</maven.install.skip> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
<maven.site.skip>true</maven.site.skip> | ||
<graylog2.plugin-dir>/usr/share/graylog-server/plugin</graylog2.plugin-dir> | ||
<graylog2.version>2.0.0</graylog2.version> | ||
|
||
<graylog.version>2.4.0</graylog.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>net.sf.xenqtt</groupId> | ||
<groupId>net.xenqtt</groupId> | ||
<artifactId>xenqtt</artifactId> | ||
<version>0.9.7</version> | ||
<version>1.0.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.graylog2</groupId> | ||
<artifactId>graylog2-server</artifactId> | ||
<version>${graylog2.version}</version> | ||
<groupId>com.google.auto.service</groupId> | ||
<artifactId>auto-service</artifactId> | ||
<version>${auto-service.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.auto.service</groupId> | ||
<artifactId>auto-service</artifactId> | ||
<version>1.0-rc2</version> | ||
<groupId>com.google.auto.value</groupId> | ||
<artifactId>auto-value</artifactId> | ||
<version>${auto-value.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<version>${junit.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>2.0.52-beta</version> | ||
<version>${mockito.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5.1</version> | ||
<configuration> | ||
<annotationProcessors> | ||
<annotationProcessor>com.google.auto.service.processor.AutoServiceProcessor | ||
</annotationProcessor> | ||
<annotationProcessor>com.google.auto.service.processor.AutoServiceProcessor</annotationProcessor> | ||
<annotationProcessor>com.google.auto.value.processor.AutoValueProcessor</annotationProcessor> | ||
</annotationProcessors> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Graylog-Plugin-Properties-Path>${project.groupId}.${project.artifactId}</Graylog-Plugin-Properties-Path> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>2.4.3</version> | ||
<configuration> | ||
<minimizeJar>true</minimizeJar> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
<minimizeJar>false</minimizeJar> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-release-plugin</artifactId> | ||
<version>2.5.2</version> | ||
<configuration> | ||
<autoVersionSubmodules>true</autoVersionSubmodules> | ||
<mavenExecutorId>forked-path</mavenExecutorId> | ||
<tagNameFormat>@{project.version}</tagNameFormat> | ||
<preparationGoals>clean test</preparationGoals> | ||
<goals>package</goals> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.vafer</groupId> | ||
<artifactId>jdeb</artifactId> | ||
<version>1.5</version> | ||
<configuration> | ||
<deb>${project.build.directory}/${project.artifactId}-${project.version}.deb</deb> | ||
<dataSet> | ||
<data> | ||
<src>${project.build.directory}/</src> | ||
<includes>${project.build.finalName}.jar</includes> | ||
<type>directory</type> | ||
<mapper> | ||
<type>perm</type> | ||
<prefix>${graylog2.plugin-dir}</prefix> | ||
<filemode>644</filemode> | ||
<user>root</user> | ||
<group>root</group> | ||
</mapper> | ||
</data> | ||
</dataSet> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>rpm-maven-plugin</artifactId> | ||
<version>2.1.5</version> | ||
<configuration> | ||
<group>Application/Internet</group> | ||
<prefix>/usr</prefix> | ||
<defineStatements> | ||
<defineStatement>_unpackaged_files_terminate_build 0</defineStatement> | ||
<defineStatement>_binaries_in_noarch_packages_terminate_build 0</defineStatement> | ||
</defineStatements> | ||
<defaultFilemode>644</defaultFilemode> | ||
<defaultDirmode>755</defaultDirmode> | ||
<defaultUsername>root</defaultUsername> | ||
<defaultGroupname>root</defaultGroupname> | ||
<mappings> | ||
<mapping> | ||
<directory>${graylog2.plugin-dir}</directory> | ||
<sources> | ||
<source> | ||
<location>${project.build.directory}/</location> | ||
<includes> | ||
<include>${project.build.finalName}.jar</include> | ||
</includes> | ||
</source> | ||
</sources> | ||
</mapping> | ||
</mappings> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.graylog2.inputs.mqtt; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.google.inject.assistedinject.Assisted; | ||
import com.google.inject.assistedinject.AssistedInject; | ||
import org.graylog2.inputs.codecs.RawCodec; | ||
import org.graylog2.plugin.LocalMetricRegistry; | ||
import org.graylog2.plugin.ServerStatus; | ||
import org.graylog2.plugin.configuration.Configuration; | ||
import org.graylog2.plugin.inputs.MessageInput; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class MQTTRawInput extends MessageInput { | ||
private static final String NAME = "MQTT TCP (Raw/Plaintext)"; | ||
|
||
@AssistedInject | ||
public MQTTRawInput(final MetricRegistry metricRegistry, | ||
@Assisted Configuration configuration, | ||
MQTTTransport.Factory mqttTransportFactory, | ||
RawCodec.Factory rawCodecFactory, | ||
LocalMetricRegistry localRegistry, | ||
Config config, | ||
Descriptor descriptor, ServerStatus serverStatus) { | ||
super(metricRegistry, configuration, mqttTransportFactory.create(configuration), localRegistry, rawCodecFactory.create(configuration), config, descriptor, serverStatus); | ||
} | ||
|
||
public interface Factory extends MessageInput.Factory<MQTTRawInput> { | ||
@Override | ||
MQTTRawInput create(Configuration configuration); | ||
|
||
@Override | ||
Config getConfig(); | ||
|
||
@Override | ||
Descriptor getDescriptor(); | ||
} | ||
|
||
public static class Descriptor extends MessageInput.Descriptor { | ||
@Inject | ||
public Descriptor() { | ||
super(NAME, false, "https://github.com/graylog-labs/graylog-plugin-mqtt"); | ||
} | ||
} | ||
|
||
public static class Config extends MessageInput.Config { | ||
@Inject | ||
public Config(MQTTTransport.Factory transport, RawCodec.Factory codec) { | ||
super(transport.getConfig(), codec.getConfig()); | ||
} | ||
} | ||
} |
Oops, something went wrong.