tree: 0da0049d6d19d2b9d709fd3816843742b131fec8 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
plc4j/integrations/logstash-plugin/README.md

Logstash Java Plugin

Travis Build Status

This is a Java plugin for Logstash.

It is fully free and fully open source. The license is Apache 2.0, meaning you are free to use it however you want.

The documentation for Logstash Java plugins is available here.

Example input pipeline for logstash:

## logstash pipeline config - input
input {
	## use plc4x plugin (logstash-input-plc4x)
	plc4x {
		## define sources (opc-ua examples)
		sources => {
			source1 => "opcua:tcp://opcua-server:4840/"
			source2 => "opcua:tcp://opcua-server1:4840/"
		}
		## define jobs
		jobs => {
			job1 => {
				# pull rate in milliseconds
				rate => 1000
				# sources queried by job1
				sources => ["source1"]
				# defined queries [logstash_internal_fieldname => "IIoT query"]
				queries =>  {
					PreStage => "ns=2;i=3"
					MidStage => "ns=2;i=4"
					PostStage => "ns=2;i=5"
					Motor => "ns=2;i=6"
					ConvoyerBeltTimestamp => "ns=2;i=7"
					RobotArmTimestamp => "ns=2;i=8"
				}
			}
		}
	}
}

Build the plugin:

./mvnw clean package -P with-java,with-logstash

To install the plugin:

  1. Copy the build plugin logstash-input-plc4x-0.5.0.gem from your target/gem directory to the Logstash plugin directory logstash/plugin
  2. Follow installation instructions from Logstash documentation: https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html
  3. Create pipeline file (see example pipeline above)