gpt4 book ai didi

amazon-web-services - Kinesis 代理不解析文件

转载 作者:行者123 更新时间:2023-12-05 05:20:19 24 4
gpt4 key购买 nike

我在 agent.json 中有以下内容

{
"cloudwatch.emitMetrics": true,
"kinesis.endpoint": "",
"firehose.endpoint": "",
"flows": [
{
"filePattern": "/home/ec2-user/ETLdata/contracts/Delta.csv",
"kinesisStream": "ETL-rawdata-stream",
"partitionKeyOption": "RANDOM",
"dataProcessingOptions": [
{
"optionName": "CSVTOJSON",
"customFieldNames": [ "field1", "field2"],
"delimiter": ","
}
]
}
]
}

当我将指定的文件添加到文件夹时,几乎没有任何反应。我只在日志中看到以下内容。为什么它根本不解析文件。有人知道吗?

更新:当我将文件模式设为/tmp/delta.csv 时它会起作用。看起来像是权限问题,但日志中没有错误。

Tailer Progress: Tailer has parsed 0 records (0 bytes), transformed 0 records, skipped 0 records, and has successfully sent 0 records to destination. 2017-06-22 18:12:03.671+0000 (Agent.MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Progress: 0 records parsed (0 bytes), and 0 records sent successfully to destinations. Uptime: 300020ms

最佳答案

我遇到了类似的问题,我可以通过执行以下操作来解决它:

  1. 将要发送到 kinesis firehose 流(一堆 CSV 文件)的数据从 ~/ec2-user/out-data 移动到另一个目录:

    mv *.csv /tmp/out-data
  2. 编辑 agent.json 文件,使代理从文件开头开始读取 - 这是我的 agent.json 文件:

    {
    "cloudwatch.emitMetrics": true,
    "firehose.endpoint": "firehose.eu-west-1.amazonaws.com",
    "flows": [
    {
    "filePattern": "/tmp/out-data/trx_headers_2017*",
    "deliveryStream": "TestDeliveryStream",
    "initialPosition": "START_OF_FILE"
    }
    ]
    }

我的猜测是您的 Delta.csv 文件正在被写入,因此运动代理正在检查文件的末尾并且没有发现新记录,如果您添加 "initialPosition": "START_OF_FILE" 修复它将从文件开头开始解析。

关于amazon-web-services - Kinesis 代理不解析文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44706843/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com