Hi,
the index template you're trying to use is invalid. It's missing the name
of the document type you're trying to create a mapping for.
The correct index template is as follows:
{
"template" : "graylog_*",
"mappings" : {
"message": {
"result" : { "type" : "string" }
}
}
}
Also see IndexMapping:34
<https://github.com/Graylog2/graylog2-server/blob/1.3.2/graylog2-server/src/main/java/org/graylog2/indexer/IndexMapping.java#L34>
.
Cheers,
Jochen
On Monday, 4 January 2016 11:30:26 UTC+1, eleftherios Banos wrote:
>
> I am using the following index template for a specific field "result" :
>
> curl -XPUT localhost:9200/_template/graylog -d '
> {
> "template" : "graylog_*",
> "mappings" : {
> "result" : { "type" : "string" }
> }
> }
> '
>
> But when I am trying to cycle the index manually the following error
> appear.
> I can not see what I am doing wrong.
>
> * I suppose that the same error will appear when the index is cycled
> automatically.
>
> Thank you,
> Lefteris.
>
>
>
> 2016-01-04_10:19:43.32147 INFO [DeflectorResource] Cycling deflector.
> Reason: REST request.
> 2016-01-04_10:19:43.33468 INFO [Deflector] Cycling deflector to next
> index now.
> 2016-01-04_10:19:43.34045 INFO [Deflector] Cycling from <graylog_22> to
> <graylog_23>
> 2016-01-04_10:19:43.34374 INFO [Deflector] Creating index target
> <graylog_23>...
> 2016-01-04_10:19:43.36150 ERROR [AnyExceptionClassMapper] Unhandled
> exception in REST resource
> 2016-01-04_10:19:43.36636
> org.elasticsearch.index.mapper.MapperParsingException: mapping [result]
> 2016-01-04_10:19:43.36905 at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:394)
> 2016-01-04_10:19:43.36954 at
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:374)
> 2016-01-04_10:19:43.37241 at
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:204)
> 2016-01-04_10:19:43.37600 at
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:167)
> 2016-01-04_10:19:43.37818 at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 2016-01-04_10:19:43.37956 at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 2016-01-04_10:19:43.37993 at java.lang.Thread.run(Thread.java:745)
> 2016-01-04_10:19:43.38073 Caused by:
> org.elasticsearch.index.mapper.MapperParsingException: Root type mapping
> not empty after parsing! Remaining fields: [type : string]
> 2016-01-04_10:19:43.38133 at
> org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:278)
> 2016-01-04_10:19:43.38357 at
> org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
> 2016-01-04_10:19:43.38361 at
> org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:449)
> 2016-01-04_10:19:43.38446 at
> org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:307)
> 2016-01-04_10:19:43.38515 at
> org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:391)
> 2016-01-04_10:19:43.38717 ... 6 more
>
--
You received this message because you are subscribed to the Google Groups
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/graylog2/2dd4ee4e-593f-483c-a113-c952609cb155%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.