godaddy / kibana4-backup

MIT License
17 stars 8 forks source link

Beautified files will not work #10

Open gshively11 opened 9 years ago

gshively11 commented 9 years ago

The elasticsearch-dump module will not work correctly with beautified files. We need a PR on their project to fix this.

Discovered in https://github.com/godaddy/kibana4-backup/issues/9

mkliu commented 9 years ago

so i ran this very frequently and see it kept on committing to git, but actually the dashboard hasn't changed. it kept on committing to git, it would remove the last part

  analyze_wildcard 

in one commit, then add it back in another commit.

  {"_index":".kibana","_type":"dashboard","_id":"xxx-logs","_score":0,"_source":{"title":"xxx logs","hits":0,"description":"","panelsJSON":"[{\"col\":1,\"id\":\"xxx-logs\",\"row\":1,\"size_x\":9,\"size_y\":6,\"type\":\"search\"},{\"col\":10,\"id\":\"xxx-errors-by-service\",\"row\":1,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"}]","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[{\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}}}]}"}}}"*\",\"analyze_wildcard\":true}}}"}}}
gshively11 commented 9 years ago

strange, i'll have to do a little research. i'll be afk for the next week or so, will look into it when i get back.

mkliu commented 9 years ago

ah, i think i found the problem now. It's naming collisions. And happens because the file name is the object name. I have two files running into this problem

  1. Two visualizations with the same name, but with different upper and lower case.
  2. One is visualization, another is Search object. They have exactly the same name.

Since Kibana doesn't enforce unique names, this is definitely gonna happen. For #1, maybe post fix create a hash based on it's name? For #2, you could simply prefix with the object type

gshively11 commented 9 years ago

Ah, good catch, created https://github.com/godaddy/kibana4-backup/issues/14 to track it.