bhatikuldeep / hello-world-elk-logging

This API proxy demonstrates message logging from Apigee Edge to ELK (Elastic, Logstash, Kibana) stack.
GNU General Public License v3.0
7 stars 5 forks source link

messagelogginpolicy not ableto send logs to logstash #2

Open amitnekar opened 4 months ago

amitnekar commented 4 months ago

logstash is http and on port 5044 what could be wrong. there is no error showing in apigee. However if i try to write to logstash from outside apigee like a javascript code then it shows something in the logstash logs. though not accurate but still it generates some logs and also elastic search is creating index.

But only from apigee its not writing to logstash.

messagelogging policy

`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

MessageLogging.Log {msgLogs} 192.168.99.2 5044 TCP true false INFO

` logstash.conf input { tcp { port => 5044 type => syslog ssl_enable => false } } filter { mutate { gsub => [ "message", "[\u0000]", "" ] remove_field => ["timestamp", "host", "facility_label", "severity_label", "severity", "facility", "priority"] } grok { match => {"message" => "<%{NUMBER:priority_index}>%{DATESTAMP_OTHER:apigeeTimestamp}%{LOGLEVEL}: %{GREEDYDATA:apigeeMessage}"} remove_field => ["message"] } json { source => "apigeeMessage" target => "message" remove_field => ["apigeeMessage"] } } output {

added below line to see how the message is outputed/parsed with logstash filer, you can remove below line (only stdout { codec => rubydebug }), if necessary.

stdout { codec => rubydebug }
elasticsearch {
    hosts => ["http://192.168.99.2:9200"]
    index => "apigee-%{+YYYY.MM.dd}"
    ssl => false
}

}

amitnekar commented 4 months ago

Incidentally from telnet its working fine. But i think somehow apigee is not able to connect to ip http://192.168.99.2:5044/. This ip is on my local docker. However this ip accessible thru internet but somehow not thru apigee. What could be the issue.