We had given a task, but facing issue in it. Task is -
Try adding tag A if the data read is a.
a
b
a
c
d
Ensure that the input data is tagged with type as test , and write the output to the file output.txt in the path usr/share/logstash.
input {
stdin {
add_tag => ["A"]
type => "test"
path => ["/usr/share/logstash/output.txt"]
}
}
Please let us know our mistake
ptamba
June 4, 2020, 12:21pm
2
your input config will add tag [“A”] and type “test” to any events coming to that input.
if you need to do conditional tags, you need to use filter plugin
to write outputs , use file output plugin
We need dis
tag A if the data read is a.
a
b
a
c
d
ptamba
June 4, 2020, 12:28pm
4
you can use mutate filter
something like
filter {
if [<field_name_>] == “A” {
mutate => {
add_tag => “A” }
}
}
system
(system)
Closed
July 2, 2020, 12:28pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.