У нас все логи веб-приложений пишутся в JSON, при этом "кто в лес кто по дрова". Собирается все на центральный сервер syslog-ng который переодически перестает работать из-за лимита json ключей 65к. Пытаюсь скормить такой JSON в ELK. Затыкается((((
Каждый логи JSON большой:
{"PROGRAM":"test","context":{"route":"privilege_get_token","_id":"2939","project_id":"[null]","user":"2939","user_role":"ROLE_OWNER","http_status_code":"200","plain_request":"POST /test/test/2939/token HTTP/1.1\r\nAccept: application/json\r\nAccept-Encoding: gzip,deflate,br\r\nAuthorization: Basic 9384hf9dsh4387hq0J==\r\nConnection: close\r\nContent-Length: 187\r\nContent-Type: application/json\r\nHost: api.test.com\r\nHttps: on\r\nPhp-Auth-Pw: 98h34f-sdfh\r\nPhp-Auth-User: 2939\r\nUser-Agent: AppEngine-Google; (+http://code.google.com/appengine; appid: s~realmoemadd)\r\nX-Cloud-Trace-Context: d585aa33f31342534f3457379d5f/125734ref3ef3d410406\r\nX-Forwarded-For: 107.10.33.79\r\nX-Forwarded-Port: 443\r\nX-Forwarded-Proto: https\r\nX-Php-Ob-Level: 2\r\nX-Real-Ip: 107.10.33.79\r\n\r\n{\"user\": {\"id\": {\"hidden\": true, \"value\": \"stworks:76584\"}, \"email\": {\"value\": \"stworks: 76584\"}}, \"settings\": {\"project_id\": 20, \"ui\": {\"theme\": \"dark\"}}}"},"level_name":"INFO","datetime":"2017-02-15 23:59:59","extra":{"uid":"1b7","http":{"SERVER":{"HTTP_HOST":"api.test.com","HTTP_X_REAL_IP":"107.10.33.79","REMOTE_ADDR":"107.10.33.79","CONTENT_TYPE":"application/json","REQUEST_URI":"/test/test/2939/token","QUERY_STRING":""},"PHP_INPUT":{"user":{"id":{"hidden":"[true]","value":"stworks:76592484"},"email":{"value":"stworks:76561184"}},"settings":{"project_id":"20","ui":{"theme":"dark"}}}}},"MESSAGE":"API response","LEVEL_NUM":"6","HOST":"api.local","UNIXTIME":1487192399,"SOURCEIP":"172.16.16.12","ISODATE":"2017-02-15T23:59:59+03:00"}
Конфиг для logstash пытался делать такой:
input {
file {
type => "json"
path => [ "api.local.txt" ]
start_position => "beginning"
}
}
filter {
if [type] == "json" {
json {
source => "message"
add_tag => ["tokens"]
}
}
}
output {
if [type] == "json" {
elasticsearch {
hosts => ["localhost:9200"]
sniffing => false
manage_template => false
index => "token-%{+ddMMYYYY}-%{type}"
document_type => "%{type}"
}
}
}
Подскажите что нужно еще использоваться чтобы оптимизировано парсить такие json?