Twitter から Web サービス データを受け取り、ファイルにログを記録しています。その後、そのデータを Logstash に送信して、Elasticsearch にインデックスを作成できるようにする必要があります。
私は以下の設定を使用していますが、それはjsonparsefailureを例外として与えています
JSON 解析の失敗。プレーンテキストへのフォールバック {:error=>#> LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a >valid value (number, String, array, object, 'true' 、「false」または「null」)
私のlogstash confファイルは次のようになります:
input
{
file
{
path => ["/mnt/volume2/ELK_Prashant/at/events.json"]
codec => json
type => json
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
output
{
stdout { codec => rubydebug }
}
また、events.json のデータは、以下のサンプルを使用して
https://dev.twitter.com/rest/reference/get/search/tweetsから参照できます。events.json
[
{ "location": "LA, CA",
"follow_request_sent": null,
"profile_link_color": "0084B4",
"is_translator": false,
"id_str": "137238150",
"entities": {
"url": {
"urls": [
{
"expanded_url": null,
"url": ""
}
]
}
}
}
]