push apigee Message Policy logs to an ELK Server

Not applicable

Hello All,

I have build a ELK server with AWS node. I have also created a sample API Proxy which contains a Message Policy that will log the details. Now i want to send my logs to this ELK server.

Any suggestions are appreciated

1 6 1,525
6 REPLIES 6

Not applicable

So how i will link my apigee eval to the ELK server, so that i can send Message Policy logs to ELK server which is running in my AWS server.

sidd-harth
Participant V

Hi @Shijith Thomas, you can make use of Message Logging Policy to write logs to an Syslog server.

IMO Logstash supports syslog as input, so from there push to ElasticSearch and view in Kibana.

I hope this helps.

Thanks for the reply @Siddharth Barahalikar
So what i understood is, we need to put the logs in syslog server in the Message Logging Policy:

<MessageLoggingname="LogToSyslog">
<Syslog>
	<Message>[3f509b58 tag="{organization.name}.{apiproxy.name}.{enviro	nment.name}"] Weather request for WOEID {request.queryparam.w}.
	</Message>
	<Host>logs-01.loggly.com</Host>
	<Port>514</Port>
	<Protocol>TCP</Protocol>
	<FormatMessage>true</FormatMessage>
</Syslog>
<logLevel>ALERT</logLevel>
</MessageLogging>

Here i can replace the <host> with my ELK server ip and <port> with my port number?

I have placed this Message policy in the Post client Flow


Will that be a workaround ?

Hi @Shijith Thomas, apologies for a late reply, yes your policy should have worked, anyway, for reference purpose this is what I think should be done,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging  async="false" continueOnError="false" enabled="true"  name="Message-Logging-ELK"> 
<DisplayName>Message Logging ELK</DisplayName> 
<Syslog> 
  <Message>{system.time.month}-{system.time.day} {apiproxy.name}</Message>     
  <Host>logstash.xxxx.com</Host> 
  <Port>514</Port> 
</Syslog>

Sending the logs to Logstast Server.

pranjalic
Participant II

@avatar imageShijith Thomas is it working?

Hi @Pranjali, this should work, give it a try. If it doesn't work, please create a new topic with you requirement & issues.