简体   繁体   English

如何配置logstash以向APIGEE Analytics API发出请求?

[英]How to configure logstash to make an request to APIGEE analytics API?

I am very new to ELK stack and am trying to hit APIGEE analytics REST API, which is in the form of a URL. 我对ELK堆栈非常陌生,正在尝试使用URL形式的APIGEE Analytics REST API。 The response from the URL would be a JSON file. URL的响应将是一个JSON文件。 What is the best approach to go ahead with the implementation? 进行实施的最佳方法是什么?

I hope the question is still valid. 我希望这个问题仍然有效。 If I understand it correctly you want to send logging data to an ELK stack. 如果我理解正确,则希望将日志记录数据发送到ELK堆栈。 So why not send it instead of retrieving it? 那么,为什么不发送而不是检索呢?

Below is an example of how this policy works on the apigee platform. 以下是此策略在apigee平台上如何工作的示例。 You need to add it to any API proxy and preferably at the PostClientFlow: 您需要将其添加到任何API代理中,最好添加到PostClientFlow上:

....
</PostFlow>
<PostClientFlow>
    <Response>
        <Step>
            <Name>Message-Logging-Policy1</Name>
        </Step>
    </Response>
</PostClientFlow>

Below the policy. 低于政策。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging  async="false" continueOnError="false" enabled="true"      name="Message-Logging-1">
<DisplayName>Message Logging</DisplayName>
<Syslog>
    <Message>{system.time.year}-{system.time.month}-{system.time.day}:{system.time.hour}-{system.time.minute}-{system.time.second}.{system.time.millisecond} {apiproxy.name} {request.header.x-requestor-app} {request.header.x-realm} [{request.header.x-requestor-type}|{request.header.x-requestor}] </Message>
    <Host>logstash.xxxx.com</Host>
    <Port>514</Port>
</Syslog>

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM