zoukankan      html  css  js  c++  java
  • zabbix+elasticsearch

    curl -X PUT "http://127.0.0.1:9200/_template/uint_template" -H 'Content-Type: application/json' -d'
    {
    "index_patterns": ["uint*"],
    "settings" : {
    "index" : {
    "number_of_replicas" : 1,
    "number_of_shards" : 5
    }
    },
    "mappings" : {
    "values" : {
    "properties" : {
    "itemid" : {
    "type" : "long"
    },
    "clock" : {
    "format" : "epoch_second",
    "type" : "date"
    },
    "value" : {
    "type" : "long"
    }
    }
    }
    }
    }'
    curl -X PUT
    http://127.0.0.1:9200/_template/uint_template
    -H 'content-type:application/json'
    -d '{
    "index_patterns": [
    "uint*"
    ],
    "settings": {
    "index": {
    "number_of_replicas": 1,
    "number_of_shards": 5
    }
    },
    "mappings": {
    "properties": {
    "itemid": {
    "type": "long"
    },
    "clock": {
    "format": "epoch_second",
    "type": "date"
    },
    "value": {
    "type": "long"
    }
    }
    }
    }'
    curl -X PUT
    http://127.0.0.1:9200/_template/db1_template
    -H 'content-type:application/json'
    -d '{
    "index_patterns": [
    "db1*"
    ],
    "settings": {
    "index": {
    "number_of_replicas": 1,
    "number_of_shards": 5
    }
    },
    "mappings": {
    "properties": {
    "itemid": {
    "type": "long"
    },
    "clock": {
    "format": "epoch_second",
    "type": "date"
    },
    "value": {
    "type": "double"
    }
    }
    }
    }'
    curl -X PUT
    http://127.0.0.1:9200/_template/text_template
    -H 'content-type:application/json'
    -d '{
    "index_patterns": [
    "text*"
    ],
    "settings": {
    "index": {
    "number_of_replicas": 1,
    "number_of_shards": 5
    }
    },
    "mappings": {
    "properties": {
    "itemid": {
    "type": "long"
    },
    "clock": {
    "format": "epoch_second",
    "type": "date"
    },
    "value": {
    "fields": {
    "analyzed": {
    "index": true,
    "type": "text",
    "analyzer": "standard"
    }
    },
    "index": false,
    "type": "text"
    }
    }
    }
    }'

    curl -X PUT
    http://127.0.0.1:9200/_template/str_template
    -H 'content-type:application/json'
    -d '{
    "index_patterns": [
    "str*"
    ],
    "settings": {
    "index": {
    "number_of_replicas": 1,
    "number_of_shards": 5
    }
    },
    "mappings": {
    "properties": {
    "itemid": {
    "type": "long"
    },
    "clock": {
    "format": "epoch_second",
    "type": "date"
    },
    "value": {
    "fields": {
    "analyzed": {
    "index": true,
    "type": "text",
    "analyzer": "standard"
    }
    },
    "index": false,
    "type": "text"
    }
    }
    }
    }'


    curl -X PUT
    http://127.0.0.1:9200/_template/log_template
    -H 'content-type:application/json'
    -d '{
    "index_patterns": [
    "log*"
    ],
    "settings": {
    "index": {
    "number_of_replicas": 1,
    "number_of_shards": 5
    }
    },
    "mappings": {
    "properties": {
    "itemid": {
    "type": "long"
    },
    "clock": {
    "format": "epoch_second",
    "type": "date"
    },
    "value": {
    "fields": {
    "analyzed": {
    "index": true,
    "type": "text",
    "analyzer": "standard"
    }
    },
    "index": false,
    "type": "text"
    }
    }
    }
    }'

    curl -X PUT
    http://127.0.0.1:9200/_ingest/pipeline/uint-pipeline
    -H 'content-type:application/json'
    -d '{
    "description": "daily uint index naming",
    "processors": [
    {
    "date_index_name": {
    "field": "clock",
    "date_formats": [
    "UNIX"
    ],
    "index_name_prefix": "uint-",
    "date_rounding": "d"
    }
    }
    ]
    }'


    curl -X PUT
    http://127.0.0.1:9200/_ingest/pipeline/str-pipeline
    -H 'content-type:application/json'
    -d '{
    "description": "daily uint index naming",
    "processors": [
    {
    "date_index_name": {
    "field": "clock",
    "date_formats": [
    "UNIX"
    ],
    "index_name_prefix": "str-",
    "date_rounding": "d"
    }
    }
    ]
    }'

    curl -X PUT
    http://127.0.0.1:9200/_ingest/pipeline/text-pipeline
    -H 'content-type:application/json'
    -d '{
    "description": "daily uint index naming",
    "processors": [
    {
    "date_index_name": {
    "field": "clock",
    "date_formats": [
    "UNIX"
    ],
    "index_name_prefix": "text-",
    "date_rounding": "d"
    }
    }
    ]
    }'

    curl -X PUT
    http://127.0.0.1:9200/_ingest/pipeline/log-pipeline
    -H 'content-type:application/json'
    -d '{
    "description": "daily uint index naming",
    "processors": [
    {
    "date_index_name": {
    "field": "clock",
    "date_formats": [
    "UNIX"
    ],
    "index_name_prefix": "log-",
    "date_rounding": "d"
    }
    }
    ]
    }'

    curl -X PUT
    http://127.0.0.1:9200/_ingest/pipeline/dbl-pipeline
    -H 'content-type:application/json'
    -d '{
    "description": "daily uint index naming",
    "processors": [
    {
    "date_index_name": {
    "field": "clock",
    "date_formats": [
    "UNIX"
    ],
    "index_name_prefix": "dbl-",
    "date_rounding": "d"
    }
    }
    ]
    }'

  • 相关阅读:
    F2. Same Sum Blocks (Hard) 解析(思維、前綴和、貪心)
    E. Copying Data 解析(線段樹)
    B. Nauuo and Circle 解析(思維、DP)
    POJ3436-ACM Computer Factory(最大流)
    A.牛牛扔牌(双端队列)/B.疯狂过山车(最长上升子序列)/C.牛牛的棋盘(容斥原理)
    CodeForces 665E. Beautiful Subarrays(字典树)(贪心)(异或前缀和)
    CodeForces 455C.Civilization(并查集)(树的直径)
    CodeForces 1021B. Chemical table(并查集)
    CodeForces 961E. Tufurama(主席树)
    CodeForces 1024C. Array Product(模拟)(分类讨论)
  • 原文地址:https://www.cnblogs.com/joycezhou/p/13477029.html
Copyright © 2011-2022 走看看