Geeboy
(Geeboy)
September 7, 2023, 12:29am
1
Good day!
Im creating new index, when I add this to "data views", it was tagged as TEXT type. I need it to be integer. do you have step by step guide for this case?
my temporary solution is this command -> emit (Integer.parseInt(doc['keyword'].value))
please ignore the "DATE", I already change the format.
Im using td-agent as log forwarder
"indextrnxcount-000001" : {
"mappings" : {
"properties" : {
"DATE" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"TransactionCount" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"tailed_path" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
Thank you very much
cperzrt10
(Cristian)
September 7, 2023, 11:13am
2
Hi @Geeboy , you must try to create an index template here
Then select index template and create or edit your template
Here the documentation to do via dev tools in kibana.
Geeboy
(Geeboy)
September 11, 2023, 1:42am
3
thank you for the info. how can I insert my mappings in my sample template below?
{
"index_templates" : [
{
"name" : "smpphourly-template",
"index_template" : {
"index_patterns" : [
"smpphourly-*"
],
"template" : {
"settings" : {
"index" : {
"lifecycle" : {
"name" : "180-days-default",
"rollover_alias" : "index-alias"
},
"number_of_shards" : "1",
"number_of_replicas" : "0"
}
},
"mappings" : {
"_source" : {
"enabled" : true
}
}
},
"composed_of" : [ ]
}
}
]
}
cperzrt10
(Cristian)
September 11, 2023, 6:27am
4
Hi, here an example:
PUT _index_template/smpphourly-template
{
"template": {
"settings" : {
"index" : {
"lifecycle" : {
"name" : "180-days-default",
"rollover_alias" : "index-alias"
},
"number_of_shards" : "1",
"number_of_replicas" : "0"
}
}
"mappings": {
"dynamic": true,
"numeric_detection": false,
"date_detection": true,
"dynamic_date_formats": [
"strict_date_optional_time",
"yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
],
"_source": {
"enabled": true,
"includes": [],
"excludes": []
},
"_routing": {
"required": false
},
"dynamic_templates": [],
"properties": {
"TransactionCount": {
"type": "integer"
}
}
}
},
"index_patterns": [
"smpphourly-*"
]
}
1 Like
Geeboy
(Geeboy)
September 12, 2023, 3:21am
5
thank you very much @cperzrt10 . great help
1 Like
system
(system)
Closed
October 10, 2023, 3:21am
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.