Skip to content

Instantly share code, notes, and snippets.

@tecsyscom
Created May 23, 2017 08:56
Show Gist options
  • Save tecsyscom/15339f2984df4b5e71998a45753ce0a9 to your computer and use it in GitHub Desktop.
Save tecsyscom/15339f2984df4b5e71998a45753ce0a9 to your computer and use it in GitHub Desktop.
how to get an template example for twitter
{
"template": "twitter_elastic_example",
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
"_all": {
"enabled": true
},
"properties": {
"@timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"text": {
"type": "text"
},
"user": {
"type": "object",
"properties": {
"description": {
"type": "text"
}
}
},
"coordinates": {
"type": "object",
"properties": {
"coordinates": {
"type": "geo_point"
}
}
},
"entities": {
"type": "object",
"properties": {
"hashtags": {
"type": "object",
"properties": {
"text": {
"type": "text",
"fielddata": true
}
}
}
}
},
"retweeted_status": {
"type": "object",
"properties": {
"text": {
"type": "text"
}
}
}
},
"dynamic_templates": [
{
"string_template": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
]
}
}
}
@tecsyscom
Copy link
Author

output {
stdout {
codec => dots
}
elasticsearch {
hosts => "localhost:9200"
index => "logstash-twitter_elastic_example"
document_type => "tweets"
template => "./twitter_template.json"
template_name => "twitter_elastic_example"
template_overwrite => true
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment