如下图所示 , 我在这定义了 HOSTNAME 和 PORT 两个参数
但是在验证过程中,出现
这个是什么原因呢。。求各位大佬解答
@LogstashPlugin(name = "java_output_example")
public class JavaOutputExample implements Output {
public static final PluginConfigSpec<String> PREFIX_CONFIG =
PluginConfigSpec.stringSetting("prefix", "");
public static final PluginConfigSpec<String> HOSTNAME =
PluginConfigSpec.stringSetting("hostname", "192.168.43.17");
public static final PluginConfigSpec<String> PORT =
PluginConfigSpec.stringSetting("port", "26666");
private final String id;
private String prefix;
private PrintStream printer;
private final CountDownLatch done = new CountDownLatch(1);
private volatile boolean stopped = false;
// 定义转发参数
private String hostname;
private String port;
private TcpClient tcpClient;
// all plugins must provide a constructor that accepts id, Configuration, and Context
public JavaOutputExample(final String id, final Configuration configuration, final Context context) {
this(id, configuration, context, null);
}
JavaOutputExample(final String id, final Configuration config, final Context context, OutputStream targetStream) {
// constructors should validate configuration options
this.id = id;
prefix = config.get(PREFIX_CONFIG);
// 初始化相应参数
hostname = config.get(HOSTNAME);
port = config.get(PORT);
tcpClient = new TcpClient(hostname, Integer.valueOf(port));
tcpClient.connect();
}
然后 ,我在使用控件的时候但是在验证过程中,出现
这个是什么原因呢。。求各位大佬解答
1 个回复
yu89780012
赞同来自:
问题已处理,两处均需要定义。