I have defined the variable like below:-
input_host_ports:
-
4000:fluent:syslog
-
4500:json:log
-
4800:plain:debuglog
I want to get the render the variables in the jinja2 for loop like below:
tcp {
port => 4000
codec => fluent
type => syslog
}
tcp {
port => 4500
codec => json {
charset => “ISO-8859-1”
}
type => debuglog
}
tcp {
port => 4800
codec => plain
type => debuglog
}
Only for the port 4500 - I want the charset and also the output should be exactly in this format and in future I may add new ports if required.