Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logstash mapping layout no longer supported in new version of elasticsearch #8

Open
mandeepm91 opened this issue Apr 11, 2016 · 3 comments

Comments

@mandeepm91
Copy link

I am getting the following error while trying to write the logs to elasticsearch using logstash layout. I reckon the issue is related to the log4js-elasticsearch-layouts.js file since the mapping being used seems no longer supported in the latest version of elasticsearch. However, even when I tried to remove the part "path": "full" from the file, I am still getting the error in elasticsearch

    "mappings" : {
      "_default_" : {
         "_all" : {"enabled" : enableAll},
         "properties" : {
            "@fields" : { "type" : "object", "dynamic": true, "path": "full"},
            "@message": { "type": "string", "index": "analyzed" },
            "@source": { "type": "string", "index": "not_analyzed" },
            "@source_host": { "type": "string", "index": "not_analyzed" },
            "@source_path": { "type": "string", "index": "not_analyzed" },
            "@tags": { "type": "string", "index": "not_analyzed" },
            "@timestamp": { "type": "date", "index": "not_analyzed" },
            "@type": { "type": "string", "index": "not_analyzed" }
         }
      }
    }

[2016-04-11 16:30:38,712][DEBUG][action.admin.indices.create] [Armory] [logstash-2016.04.11] failed to create
MapperParsingException[Failed to parse mapping [_default_]: Mapping definition for [@fields] has unsupported parameters:  [path : full]]; nested: MapperParsingException[Mapping definition for [@fields] has unsupported parameters:  [path : full]];

@satishsnv
Copy link

with some fields updated in 5.1, old mappings are not working properly. updated the template to the following working fine

{
"template": "logstash-",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index" : {
"query" : { "default_field" : "@message" }
}
},
"mappings": {
"default": {
"_all": { "enabled": false },
"dynamic_templates": [
{
"string_template" : {
"match" : "
",
"mapping": { "type": "string", "index": "not_analyzed" },
"match_mapping_type" : "string"
}
}
],
"properties" : {
"@fields": { "type": "object", "dynamic": true },
"@message" : { "type" : "string", "index" : "analyzed" },
"@source" : { "type" : "string", "index" : "not_analyzed" },
"@source_host" : { "type" : "string", "index" : "not_analyzed" },
"@source_path" : { "type" : "string", "index" : "not_analyzed" },
"@tags": { "type": "string", "index" : "not_analyzed" },
"@timestamp" : { "type" : "date", "index" : "not_analyzed" },
"@type" : { "type" : "string", "index" : "not_analyzed" },
"ipAddress" : {"type" : "ip", "index" : "analyzed"}
}
}
}
}

@bigman73
Copy link

The library is not working with Elastic Search 5.x
TypeError: Cannot read property 'messagePassThroughLayout' of undefined at Object.<anonymous> (c:\dev\temp\test_log4js_es\node_modules\log4js-elasticsearch\lib\log4js-elasticsearch-layouts.js:8:39)

@hmalphettes - can you please fix the the library to support the latest versions of ES?

@swaprks
Copy link

swaprks commented Jan 16, 2018

@hmalphettes I am also facing the same issue. Can you please help in what needs to be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants