Sample code and instructions for Java plugins will omit common configuration (eg. 'id', 'tags')
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- java
- Área
- documentation
Línea de trabajo
Start with the Java input-plugin instructions and example source, then inspect PluginHelper.commonFilterSettings in logstash-core and PluginUtil.java. Update the affected documentation and example code so the common configuration is represented for the relevant Java plugin types, and verify that the documented examples no longer omit settings such as id and tags.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Logstash 7.9 at least; although as a documentation and example-code issue, it's been around since the Java API was released.
The official instructions and example source code for creatingpure-Java input/filter/output/codec plugins for Logstash leaves out some code which means plugins created according to the instructions will cause a configuration failure such as this:
[ERROR][co.elastic.logstash.api.PluginHelper] Unknown setting 'id' specified for plugin 'mmdb'
This log appears to come from PluginUtil, despite the class indicated in the log.
The provided instructions and code will have you use the following (How to write a Java input plugin):
@Override
public Collection<PluginConfigSpec<?>> configSchema() {
return Arrays.asList(EVENT_COUNT_CONFIG, PREFIX_CONFIG);
}
This should instead be something like the following:
import co.elastic.logstash.api.PluginHelper;
...
@Override
public Collection<PluginConfigSpec<?>> configSchema() {
// The Java example I was looking at doesn't tell
// you that you need to include the common config
// too, nor does it show how.
//
// This form of commonFilterSettings, with an
// argument, will merge the provided settings with
// the common ones for filter.
//
// Note that the checking of arguments is not done
// when we run the unit-tests; that's not our
// code. You may therefore encounter this during
// integration testing instead.
return PluginHelper.commonFilterSettings(
Arrays.asList(
SOURCE_CONFIG,
TARGET_CONFIG,
DATABASE_FILENAME_CONFIG,
CACHE_SIZE_CONFIG,
FIELDS_CONFIG));
}
See the source for commonFilterSetttings
Most of the Java plugins in logstash-core get this right, such as the generator, stdin, uuid; although none of the output plugins do; though according to the documentation they should.
PS. I'm attaching this as an issue to the filter plugin, just because that's what I was working from, but clearly this affects multiple repositories and the documentation, so I'm happy to file this on another repo if you like (and can point me in the correct direction).
Cheers,
Cameron
- Lenguaje dominante
- Java
- Estrellas
- 19
- Forks
- 39
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de logstash-plugins/logstash-filter-java_filter_example
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
logstash-plugins/logstash-filter-java_filter_example#27 · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
-
Expected JAR name LoadError Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
How to use field values Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
logstash-plugins/logstash-filter-java_filter_example#15 · 1 comentario ·
Todos los issues de logstash-plugins/logstash-filter-java_filter_example
Issues similares
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/flink-agents#1152 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
objectionary/eo-graphs#75 ·