The next pipeline work good.
input {
jdbc {
jdbc_driver_library => "C:\\03_ELK\\logstash\\drivers\\ojdbc6-11.2.0.3.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@XXXXXXXXXXXXXX:1521:orcl"
jdbc_user => "XXXXXXXXXXXXX"
jdbc_password => "XXXXXXXXXXXXXXXXXXXXX"
parameters => { }
#schedule => "*/5 * * * * UTC" #cada 5 mins comprobada
schedule => "* * * * * UTC" #cada 1 min
statement => "select XXXXXXXXXXXXXX FROM XXXXXXXXXXXXXXX where rownum = 1"
}
}
filter {
if [%{tx_nombre}]=="pedro"{
mutate { add_field => { "**alert**" => "juan,cpu.id=0 1000" } }
}
}
output{
http {
format => "message"
http_method =>"post"
content_type => "text/plain"
request_timeout => 120
url => "https://xxxxxxxxxxxxxxx.live.dynatrace.com/api/v2/metrics/ingest?api-token=xxxxxxxxxxxxx"
pool_max => 1000
connect_timeout => 30
message => "juan,cpu.id=0 1000"
}
stdout { codec => rubydebug }
}
but I change the line: message => "%{alert}"
My output failet; It is not recognizing the value or perhaps the field that I added alert
Show me the following error: Encountered non-2xx HTTP code 400 {
I tried the following in my output: tx_nombre = pedro
Not work: #message => "[%{tx_nombre}],[%{tx_nombre}]=0 100"
Work: #message => "pedro,pedro=0 100"
Not work: message => "[%{tx_nombre}]"
Not work: message => "tx_nombre"
How can I concatenate this value in the message http output, additional in the filter I am adding a field ut not work