mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Added console prints in ingest-converter for not recognized processor definitions.
Adds console output for
- 'if' condition in 'set' processor
- unrecognized processor, like join
(cherry picked from commit 690bade81f
)
This commit is contained in:
parent
68f9ba899c
commit
88ceb5ccfc
2 changed files with 17 additions and 0 deletions
|
@ -26,50 +26,63 @@ function ingest_pipeline_to_logstash(json, append_stdio) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var processed = false;
|
||||||
if (IngestDate.has_date(processor)) {
|
if (IngestDate.has_date(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("date", IngestDate.date_hash(processor))
|
IngestConverter.create_hash("date", IngestDate.date_hash(processor))
|
||||||
)
|
)
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestGeoIp.has_geoip(processor)) {
|
if (IngestGeoIp.has_geoip(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("geoip", IngestGeoIp.geoip_hash(processor))
|
IngestConverter.create_hash("geoip", IngestGeoIp.geoip_hash(processor))
|
||||||
)
|
)
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestConvert.has_convert(processor)) {
|
if (IngestConvert.has_convert(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestConvert.convert_hash(processor))
|
IngestConverter.create_hash("mutate", IngestConvert.convert_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestGsub.has_gsub(processor)) {
|
if (IngestGsub.has_gsub(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestGsub.gsub_hash(processor))
|
IngestConverter.create_hash("mutate", IngestGsub.gsub_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestAppend.has_append(processor)) {
|
if (IngestAppend.has_append(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestAppend.append_hash(processor))
|
IngestConverter.create_hash("mutate", IngestAppend.append_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestJson.has_json(processor)) {
|
if (IngestJson.has_json(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("json", IngestJson.json_hash(processor))
|
IngestConverter.create_hash("json", IngestJson.json_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestRename.has_rename(processor)) {
|
if (IngestRename.has_rename(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestRename.rename_hash(processor))
|
IngestConverter.create_hash("mutate", IngestRename.rename_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestLowercase.has_lowercase(processor)) {
|
if (IngestLowercase.has_lowercase(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestLowercase.lowercase_hash(processor))
|
IngestConverter.create_hash("mutate", IngestLowercase.lowercase_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
if (IngestSet.has_set(processor)) {
|
if (IngestSet.has_set(processor)) {
|
||||||
filter_blocks.push(
|
filter_blocks.push(
|
||||||
IngestConverter.create_hash("mutate", IngestSet.set_hash(processor))
|
IngestConverter.create_hash("mutate", IngestSet.set_hash(processor))
|
||||||
);
|
);
|
||||||
|
processed = true;
|
||||||
|
}
|
||||||
|
if (!processed) {
|
||||||
|
print("WARN Found unrecognized processor named: " + Object.keys(processor)[0]);
|
||||||
}
|
}
|
||||||
return IngestConverter.join_hash_fields(filter_blocks);
|
return IngestConverter.join_hash_fields(filter_blocks);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,10 @@ var IngestSet = {
|
||||||
} else {
|
} else {
|
||||||
value_contents = value;
|
value_contents = value;
|
||||||
}
|
}
|
||||||
|
var painless_condition = set_json["if"];
|
||||||
|
if (!!painless_condition) {
|
||||||
|
print("WARN Found in 'set' processor an 'if' painless condition not translated: " + painless_condition);
|
||||||
|
}
|
||||||
var mutate_contents = IngestConverter.create_field(
|
var mutate_contents = IngestConverter.create_field(
|
||||||
IngestConverter.quote_string(IngestConverter.dots_to_square_brackets(set_json["field"])),
|
IngestConverter.quote_string(IngestConverter.dots_to_square_brackets(set_json["field"])),
|
||||||
value_contents);
|
value_contents);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue