I made two jdbc sections in my config, but I want always execute first actionA and than actionB, it's important for me. How can I do this?
Here is my config:
input {
jdbc {
type => "actionA"
jdbc_validate_connection => true
jdbc_connection_string => "jdbc:oracle:thin:@mycomp:1522/db1"
...
statement => "SELECT ID FROM my_table WHERE delete='Y'"
}
jdbc {
type => "actionB"
jdbc_validate_connection => true
jdbc_connection_string => "jdbc:oracle:thin:@mycomp:1522/db1"
...
statement => "UPDATE my_table SET delete='T' WHERE delete='Y'"
}
}
output {
stdout { codec => rubydebug }
if [type] == "actionA" {
elasticsearch {
action => "delete"
index => "contacts"
document_type => "contact"
document_id => "%{id}"
hosts => ["http://localhost:9200"]
}
}
if [type] == "actionB" { }
}
Thanks in advance
Jay
You can leverage the
scheduleparameter and makeactionAalways run beforeactionB, e.g. by makingactionArun every even minutes (0, 2, 4, 6, ...) andactionBrun every odd minutes (1, 3, 5, ...)