Aliases and template don't work together


(ciro) #1

hi, i'm using filebeat for manage my log and index them into elastic passing to ingest node.
i want create an aliases for all log and i have insert this line

"aliases" : {
"log" : { }
}

in my filebeat template.

But when i start filebeat and index is created i don't have the alias setted into my index:

"aliases" : { },

How it's possibile? I wrong something? it's a bug?

I'm using ES 5.0.0 beta1.


(Mark Walkom) #2

Can you provide the entire template?


(ciro) #3
This is my template 
{
  "mappings": {
    "_default_": {
      "_all": {
        "norms": false
      },
      "_meta": {
        "version": "5.0.0-beta1"
      },
      "dynamic_templates": [
        {
          "fields": {
            "mapping": {
              "ignore_above": 1024,
              "type": "keyword"
            },
            "match_mapping_type": "string",
            "path_match": "fields.*"
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "beat": {
          "properties": {
            "hostname": {
              "ignore_above": 1024,
              "type": "keyword"
            },
            "name": {
              "ignore_above": 1024,
              "type": "keyword"
            }
          }
        },
        "input_type": {
          "ignore_above": 1024,
          "type": "keyword"
        },
        "message": {
          "norms": false,
          "type": "text"
        },
        "offset": {
          "type": "long"
        },
        "source": {
          "ignore_above": 1024,
          "type": "keyword"
        },
        "tags": {
          "ignore_above": 1024,
          "type": "keyword"
        },
        "type": {
          "ignore_above": 1024,
          "type": "keyword"
        }
      }
    }
  },
  "order": 0,
  "settings": {
    "index.refresh_interval": "5s"
  },
  "aliases": {
        "log": {}
    },
  "template": "filebeat"
}

(Mark Walkom) #4

Can you format it please, use the </> button.


(ciro) #5

i think i have fomatted it


(Mark Walkom) #6

What is the index pattern you are using in filebeat/ingest?
Cause your template only applies to indices with a name of filebeat, not filebeat-YYYY.MM.DD which is the standard.


(ciro) #7

ohhhhh, i miss the star *. Thank for help. Now its work


(system) #8