I am working on a requirement to send data from logstash through udp to telegraf and then to influxdb. I am not seeing any errors in the logs but neither my data is reaching there, i tried sending to both ipv6 and ipv4 udp ports, using logstash 7, but nothing seems to work and i am not even seeing any relevant logs in the debug mode for udp, hence looking for some assistance on debugging the same.
I tried using codec json, rubydebug, still no luck in gettting any error msg or data going. I m trying to send a json message there.
Pls find below a sample json-
{"@timestamp":"2019-06-05T00:04:02.174-04:00","appname":"cust_store","apptype":"play","appversion":"1.0","appenvironment":"ta5","port":"9910","logger": "com.vzw.session.handler.VzActionCreator","level": "INFO", "sessionId":"POS-APP-d172eqef-0c24-41b9-82f4-188717dfc5a2{s4}","loggedInUserId":"9415863141","mtn":"","roundTripTime":"5000032","statusCode":"200"}
My logstash config looks like this-
##################################################
input {
# stdin { codec => "json"}
file {
# codec => json
path => "/app/logstash-7.1.1/qa-logs/*.log"
start_position => "beginning"
sincedb_path => "/dev/null" # for unix
}
}
filter{
# json {
# source => "message"
# #source => "[response_json]"
# }
mutate {
convert => ["roundTripTime","integer"]
}
prune {
# interpolate => true
whitelist_names => ["appname","appenvironment","sessionId","roundTripTime","tags"]
}
# if [response_json] {
mutate {
add_field => { "data_tag1" => "appname=%{appname}" }
add_field => { "data_tag2" => "appenvironment=%{appenvironment}" }
add_field => { "data_tag3" => "sessionId=%{sessionId}" }
}
# }
}
output{
# stdout {
# codec => "rubydebug"
# codec => "json"
# }
udp {
host => "10.119.4.76"
port => 8092
# codec => "rubydebug"
codec => "json"
}
## when i send directly to influxdb, it works, but that is not my goal, want to send through telegraf(to apply aggregations and time series data)
# influxdb {
# data_points => {
# "appname" => "%{appname}"
# "appenvironment" => "%{appenvironment}"
# "sessionId" => "%{sessionId}"
# "roundTripTime" => "%{roundTripTime}"
# "statusCode" => "%{statusCode}"
# "port" => "%{port}"
# }
# send_as_tags => ["appname","appenvironment","sessionId"]
# coerce_values => {
# "roundTripTime" => "integer"
# "statusCode" => "integer"
# "port" => "integer"
# }
# measurement => "oneDigital"
# host => "xx.xx.xx.xx" # some ip
# port => 8086
# ssl => "true"
# db => "somemetrics"
# user => "smuser"
# password => "smpwd"
# }
}
##################################################