Skip to content

Instantly share code, notes, and snippets.

@nicholasblexrud nicholasblexrud/data.json
Last active Mar 10, 2016

Embed
What would you like to do?
logstash file for converting multiline mixpanel events into elasticsearch
{
event: {
"name": "event_test",
"properties": {
"color": "red",
"size": "medium",
"texture": "flannel"
}
}
},{
event: {
"name": "event_test",
"properties": {
"color": "blue",
"size": "large",
"texture": "plaid"
}
}
}
input {
file {
codec => multiline {
pattern => "^\{"
negate => true
what => next
}
path => [path_to_json]
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
mutate {
gsub => ["message", "\n", ""]
remove_field => ["@timestamp", "host", "path", "@version", "tags"]
}
if [message] =~ /^{.*}$/ {
json {source => message}
}
}
output {
stdout { codec => rubydebug }
elasticsearch{
hosts =>[]
index => logstash_year_month_date
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.