Create index-patterns from console with Kibana 6.0 or 7+ (v7.0.1)

前端 未结 5 880
面向向阳花
面向向阳花 2021-01-05 07:24

I recently upgraded my ElasticStack instance from 5.5 to 6.0, and it seems that some of the breaking changes of this version has harmed my pipeline. I had a script that, dep

5条回答
  •  日久生厌
    2021-01-05 07:27

    Create index-pattern in bulk with timestamp:

    cat index_svc.txt
    my-index1
    my-index2
    my-index3
    my-index4
    my-index5
    my-index6
    
    cat index_svc.txt | while read index; do
        echo -ne "create index-pattern ${index} \t"
        curl -XPOST "http://10.0.1.44:9200/.kibana/doc/index-pattern:${index}" -H 'Content-Type: application/json' -d "{\"type\":\"index-pattern\",\"index-pattern\":{\"title\":\"${index}2020*\",\"timeFieldName\":\"@timestamp\"}}"
        echo 
    done
    

提交回复
热议问题