Advertisement
Guest User

Elastic Stack issue - cannot index due to mapping 6.3.2

a guest
Aug 13th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 15.01 KB | None | 0 0
  1. PUT for the template of the documents:
  2.  
  3.        PUT /_template/logstash-custom {
  4.       "index_patterns": ["logstash-*"],
  5.       "order": 0,
  6.       "settings": {
  7.         "number_of_shards": 5
  8.       },
  9.       "mappings": {
  10.         "doc": {
  11.           "dynamic_date_formats": ["yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss.SSSZ", "MM-dd-yyyy HH:mm:ss", "dd/MMM/yyyy:HH:mm:ss Z", "yyyy-MM-dd HH:mm:ss:SSS", "yyyy-MM-dd HH:mm:ss,SSS", "yyyy-MM-dd"],
  12.           "dynamic_templates" : [
  13.               {
  14.                   "doc" : {
  15.                       "match" : ".*DTM|.*DATE|.*Date",
  16.                       "match_pattern": "regex",
  17.                       "mapping" : {
  18.                           "type" : "date",
  19.                           "format" : "MMM dd, yyyy, HH:mm:ss.SSS Z||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd HH:mm:ss||MM-dd-yyyy HH:mm:ss||dd/MMM/yyyy:HH:mm:ss Z||yyyy-MM-dd HH:mm:ss:SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd"
  20.                       }
  21.                   }
  22.               }
  23.           ],
  24.           "properties": {
  25.             "@timestamp": {
  26.               "type": "date",
  27.               "format": "MMM dd, yyyy, HH:mm:ss.SSS Z||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd HH:mm:ss||MM-dd-yyyy HH:mm:ss||dd/MMM/yyyy:HH:mm:ss Z||yyyy-MM-dd HH:mm:ss:SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd"
  28.             },
  29.             "@version": {
  30.               "type": "keyword"
  31.             },
  32.             "beat": {
  33.               "properties": {
  34.                 "hostname": {
  35.                   "type": "text",
  36.                   "norms": false,
  37.                   "fields": {
  38.                     "keyword": {
  39.                       "type": "keyword",
  40.                       "ignore_above": 256
  41.                     }
  42.                   }
  43.                 },
  44.                 "name": {
  45.                   "type": "text",
  46.                   "norms": false,
  47.                   "fields": {
  48.                     "keyword": {
  49.                       "type": "keyword",
  50.                       "ignore_above": 256
  51.                     }
  52.                   }
  53.                 },
  54.                 "version": {
  55.                   "type": "text",
  56.                   "norms": false,
  57.                   "fields": {
  58.                     "keyword": {
  59.                       "type": "keyword",
  60.                       "ignore_above": 256
  61.                     }
  62.                   }
  63.                 }
  64.               }
  65.             },
  66.             "call": {
  67.               "properties": {
  68.                 "ACCT_NBR": {
  69.                   "type": "text",
  70.                   "norms": false,
  71.                   "fields": {
  72.                     "keyword": {
  73.                       "type": "keyword",
  74.                       "ignore_above": 256
  75.                     }
  76.                   }
  77.                 },
  78.                 "ANI": {
  79.                   "type": "text",
  80.                   "norms": false,
  81.                   "fields": {
  82.                     "keyword": {
  83.                       "type": "keyword",
  84.                       "ignore_above": 256
  85.                     }
  86.                   }
  87.                 },
  88.                 "AO": {
  89.                   "type": "text",
  90.                   "norms": false,
  91.                   "fields": {
  92.                     "keyword": {
  93.                       "type": "keyword",
  94.                       "ignore_above": 256
  95.                     }
  96.                   }
  97.                 },
  98.                 "APP": {
  99.                   "type": "text",
  100.                   "norms": false,
  101.                   "fields": {
  102.                     "keyword": {
  103.                       "type": "keyword",
  104.                       "ignore_above": 256
  105.                     }
  106.                   }
  107.                 },
  108.                 "CPA_RESULT": {
  109.                   "type": "text",
  110.                   "norms": false,
  111.                   "fields": {
  112.                     "keyword": {
  113.                       "type": "keyword",
  114.                       "ignore_above": 256
  115.                     }
  116.                   }
  117.                 },
  118.                 "CTI_CALLID": {
  119.                   "type": "text",
  120.                   "norms": false,
  121.                   "fields": {
  122.                     "keyword": {
  123.                       "type": "keyword",
  124.                       "ignore_above": 256
  125.                     }
  126.                   }
  127.                 },
  128.                 "DNIS": {
  129.                   "type": "text",
  130.                   "norms": false,
  131.                   "fields": {
  132.                     "keyword": {
  133.                       "type": "keyword",
  134.                       "ignore_above": 256
  135.                     }
  136.                   }
  137.                 },
  138.                 "JOB_ID": {
  139.                   "type": "keyword",
  140.                   "eager_global_ordinals": true,
  141.                   "norms": false,
  142.                   "fields": {
  143.                     "keyword": {
  144.                       "type": "keyword",
  145.                       "ignore_above": 256
  146.                     }
  147.                   }
  148.                 },
  149.                 "LINE_NBR": {
  150.                   "type": "text",
  151.                   "norms": false,
  152.                   "fields": {
  153.                     "keyword": {
  154.                       "type": "keyword",
  155.                       "ignore_above": 256
  156.                     }
  157.                   }
  158.                 },
  159.                 "PEG": {
  160.                   "type": "text",
  161.                   "norms": false,
  162.                   "fields": {
  163.                     "keyword": {
  164.                       "type": "keyword",
  165.                       "ignore_above": 256
  166.                     }
  167.                   }
  168.                 },
  169.                 "END_DTM": {
  170.                   "type": "date",
  171.                   "format": "MM-dd-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd HH:mm:ss||epoch_millis"
  172.                 },
  173.                 "START_DTM": {
  174.                   "type": "date",
  175.                   "format": "MM-dd-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd HH:mm:ss||epoch_millis"
  176.                 },
  177.                 "REQUEST": {
  178.                   "type": "text",
  179.                   "norms": false,
  180.                   "fields": {
  181.                     "keyword": {
  182.                       "type": "keyword",
  183.                       "ignore_above": 256
  184.                     }
  185.                   }
  186.                 },
  187.                 "RESPONSE": {
  188.                   "type": "text",
  189.                   "norms": false,
  190.                   "fields": {
  191.                     "keyword": {
  192.                       "type": "keyword",
  193.                       "ignore_above": 256
  194.                     }
  195.                   }
  196.                 },
  197.                 "RESPONSE_STATUS": {
  198.                   "type": "text",
  199.                   "norms": false,
  200.                   "fields": {
  201.                     "keyword": {
  202.                       "type": "keyword",
  203.                       "ignore_above": 256
  204.                     }
  205.                   }
  206.                 },
  207.                 "SEQ_NBR": {
  208.                   "type": "text",
  209.                   "norms": false,
  210.                   "fields": {
  211.                     "keyword": {
  212.                       "type": "keyword",
  213.                       "ignore_above": 256
  214.                     }
  215.                   }
  216.                 },
  217.                 "UNIQUE_JOBID": {
  218.                   "type": "keyword",
  219.                   "eager_global_ordinals": true,
  220.                   "norms": false,
  221.                   "fields": {
  222.                     "keyword": {
  223.                       "type": "keyword",
  224.                       "ignore_above": 256
  225.                     }
  226.                   }
  227.                 },
  228.                 "XFER_GROUP": {
  229.                   "type": "text",
  230.                   "norms": false,
  231.                   "fields": {
  232.                     "keyword": {
  233.                       "type": "keyword",
  234.                       "ignore_above": 256
  235.                     }
  236.                   }
  237.                 },
  238.                 "XFER_NBR": {
  239.                   "type": "text",
  240.                   "norms": false,
  241.                   "fields": {
  242.                     "keyword": {
  243.                       "type": "keyword",
  244.                       "ignore_above": 256
  245.                     }
  246.                   }
  247.                 },
  248.                 "XFER_PEG": {
  249.                   "type": "text",
  250.                   "norms": false,
  251.                   "fields": {
  252.                     "keyword": {
  253.                       "type": "keyword",
  254.                       "ignore_above": 256
  255.                     }
  256.                   }
  257.                 },
  258.                 "XFER_STATUS": {
  259.                   "type": "keyword",
  260.                   "eager_global_ordinals": true,
  261.                   "norms": false,
  262.                   "fields": {
  263.                     "keyword": {
  264.                       "type": "keyword",
  265.                       "ignore_above": 256
  266.                     }
  267.                   }
  268.                 }
  269.               }
  270.             },
  271.             "client_ip": {
  272.                 "type": "text",
  273.                 "norms": false,
  274.                 "fields": {
  275.                   "keyword": {
  276.                     "type": "keyword",
  277.                     "ignore_above": 256
  278.                   }
  279.                 }
  280.               },
  281.             "function": {
  282.               "type": "text",
  283.               "norms": false,
  284.               "fields": {
  285.                 "keyword": {
  286.                   "type": "keyword",
  287.                   "ignore_above": 256
  288.                 }
  289.               }
  290.             },
  291.             "geoip": {
  292.               "dynamic": "true",
  293.               "properties": {
  294.                 "ip": {
  295.                   "type": "ip"
  296.                 },
  297.                 "latitude": {
  298.                   "type": "half_float"
  299.                 },
  300.                 "location": {
  301.                   "type": "geo_point"
  302.                 },
  303.                 "longitude": {
  304.                   "type": "half_float"
  305.                 }
  306.               }
  307.             },
  308.             "log": {
  309.               "properties": {
  310.                 "level": {
  311.                   "type": "keyword",
  312.                   "eager_global_ordinals": true,
  313.                   "norms": false,
  314.                   "fields": {
  315.                     "keyword": {
  316.                       "type": "keyword",
  317.                       "ignore_above": 256
  318.                     }
  319.                   }
  320.                 },
  321.                 "message": {
  322.                   "type": "text",
  323.                   "norms": false,
  324.                   "fields": {
  325.                     "keyword": {
  326.                       "type": "keyword",
  327.                       "ignore_above": 256
  328.                     }
  329.                   }
  330.                 },
  331.                 "type": {
  332.                   "type": "keyword",
  333.                   "eager_global_ordinals": true,
  334.                   "norms": false,
  335.                   "fields": {
  336.                     "keyword": {
  337.                       "type": "keyword",
  338.                       "ignore_above": 256
  339.                     }
  340.                   }
  341.                 }
  342.               }
  343.             },
  344.             "message": {
  345.               "type": "text",
  346.               "norms": false
  347.             },
  348.             "offset": {
  349.               "type": "long"
  350.             },
  351.             "request": {
  352.               "type": "text",
  353.               "norms": false,
  354.               "fields": {
  355.                 "keyword": {
  356.                   "type": "keyword",
  357.                   "ignore_above": 256
  358.                 }
  359.               }
  360.             },
  361.             "res_code": {
  362.               "type": "text",
  363.               "norms": false,
  364.               "fields": {
  365.                 "keyword": {
  366.                   "type": "keyword",
  367.                   "ignore_above": 256
  368.                 }
  369.               }
  370.             },
  371.             "server": {
  372.               "properties": {
  373.                 "client": {
  374.                   "type": "text",
  375.                   "norms": false,
  376.                   "fields": {
  377.                     "keyword": {
  378.                       "type": "keyword",
  379.                       "ignore_above": 256
  380.                     }
  381.                   }
  382.                 },
  383.                 "name": {
  384.                   "type": "text",
  385.                   "norms": false,
  386.                   "fields": {
  387.                     "keyword": {
  388.                       "type": "keyword",
  389.                       "ignore_above": 256
  390.                     }
  391.                   }
  392.                 }
  393.               }
  394.             },
  395.             "source": {
  396.               "type": "text",
  397.               "norms": false,
  398.               "fields": {
  399.                 "keyword": {
  400.                   "type": "keyword",
  401.                   "ignore_above": 256
  402.                 }
  403.               }
  404.             },
  405.             "tags": {
  406.               "type": "text",
  407.               "norms": false,
  408.               "fields": {
  409.                 "keyword": {
  410.                   "type": "keyword",
  411.                   "ignore_above": 256
  412.                 }
  413.               }
  414.             },
  415.             "true_timestamp": {
  416.               "type": "text",
  417.               "norms": false,
  418.               "fields": {
  419.                 "keyword": {
  420.                   "type": "keyword",
  421.                   "ignore_above": 256
  422.                 }
  423.               }
  424.             }
  425.           }
  426.         }
  427.       }
  428.     }
  429.  
  430. actual error:
  431. `[2018-08-13T13:45:23,096][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"logstash-2018.08.13", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x540e8046>], :response=>{"index"=>{"_index"=>"logstash-2018.08.13", "_type"=>"doc", "_id"=>"__ubNGUBs_yBIBeOWtxx", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"expected map for property [fields] on field [MMM dd, yyyy, HH:mm:ss.SSS Z||yyyy-MM-dd'T'HH:mm:ss.SSSZ||yyyy-MM-dd HH:mm:ss||MM-dd-yyyy HH:mm:ss||dd/MMM/yyyy:HH:mm:ss Z||yyyy-MM-dd HH:mm:ss:SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd] or [fields] but got a class java.lang.String"}}}}`
  432.  
  433.  
  434. sample doc that does work, grabbed directly from Kibana:
  435.  
  436.     {
  437.       "_index": "logstash-2018.08.13",
  438.       "_type": "doc",
  439.       "_id": "lfubNGUBs_yBIBeOZd0G",
  440.       "_version": 1,
  441.       "_score": null,
  442.       "_source": {
  443.         "log.message": " getStateInfoDB(110,PULSE)",
  444.         "log.level": "DEBUG",
  445.         "log.type": "StateDataAccess",
  446.         "offset": 249376066,
  447.         "message": "DEBUG [2018-08-13 13:45:21,146] [StateDataAccess] - : getStateInfoDB(110,PULSE)",
  448.         "tags": [
  449.           "EP-filebeat",
  450.           "beats_input_codec_plain_applied"
  451.         ],
  452.         "server": {
  453.           "name": "EP-host",
  454.           "client": "asyUvd"
  455.         },
  456.         "@timestamp": "2018-08-13T18:45:21.146Z",
  457.         "@version": "1",
  458.         "source": "/opt/tomcat/logs/catalina.out",
  459.         "beat": {
  460.           "name": "example name",
  461.           "version": "6.3.2",
  462.           "hostname": "hostname.local"
  463.         }
  464.       },
  465.       "fields": {
  466.         "@timestamp": [
  467.           "2018-08-13T18:45:21.146Z"
  468.         ]
  469.       },
  470.       "sort": [
  471.         1534185921146
  472.       ]
  473.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement