sql

Synopsys

sql {
    # GOLANG driver class to load, for example, "mysql".
    driver => "mysql"

    # SQL Statement
    # 
    # When there are more than 1 statement, only data from the last one will generate events.
    statement => "SELECT * FROM mytable"

    # 
    connection_string => "username:password@tcp(192.168.1.2:3306)/mydatabase?charset=utf8"

}

Available settings

Setting Type Info Default value
driver string required ""
event_by string "row" or "result" "row"
statement location required ""
interval interval ""
connection_string string required ""
var hash {}
target string "data"

Common Options

Details

driver

  • This is a required setting
  • Value type is string
  • Default value is ""
  • GOLANG driver class to load, for example, “mysql”.

    event_by

  • Value type is string
  • Possible values : "row" or "result"
  • Default value is "row"
  • Send an event row by row or one event with all results possible values “row”, “result”

    statement

  • This is a required setting
  • Value type is location
  • Default value is ""
  • SQL Statement

    When there are more than 1 statement, only data from the last one will generate events.

    interval

  • Value type is interval
  • Default value is ""
  • Set an interval when this processor is used as a input

    connection_string

  • This is a required setting
  • Value type is string
  • Default value is ""
  • var

  • Value type is hash
  • Default value is {}
  • You can set variable to be used in Statements by using ${var}. each reference will be replaced by the value of the variable found in Statement’s content The replacement is case-sensitive.

    target

  • Value type is string
  • Default value is "data"
  • Define the target field for placing the retrieved data. If this setting is omitted, the data will be stored in the “data” field Set the value to “.” to store value to the root (top level) of the event

    Full configuration blueprint

    Expand me...