Logstash 插件

安装插件

下载 logstash-output-datahub-1.0.0.gem,运行

{YOUR_LOGSTASH_DIRECTORY}/bin/plugin install logstash-output-datahub-1.0.0.gem

配置文件

input{
    stdin{ }
}
filter {
  alter {
    add_field => { "data" => "%{message}, from %{host}" }
    add_field => { "place" => "usa" }
    add_field => { "biginttest" => "55555" }
    add_field => { "doubletest" => "3.5" }
    add_field => { "datetimetest" => "2015-12-04 23:45:06" }
  }
}
output{
    datahub{
        shard_number=>1
        aliyun_access_id=>"************"
        aliyun_access_key=>"************"
        aliyun_odps_endpoint=>"http://service.odps.aliyun.com/api"
        aliyun_odps_hub_endpoint=>"http://dh.odps.aliyun.com"
        project=>"your_projectName"
        table=>"your_tableName"
        partition=>"time=${datetimetest.strftime('%Y-%m-%d')},place=${place}"
        partition_time_format=>"%Y-%m-%d %H:%M:%S"  
        value_field=>["data","biginttest","doubletest","datetimetest"]
    }   
}

参数说明