-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoptd-qa-pipeline-por-optd-full.json
103 lines (103 loc) · 2.97 KB
/
optd-qa-pipeline-por-optd-full.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"description": "Parsing the OPTD (OpenTravelData) POR (Points of Reference) QA (Quality Assurance) reports",
"processors": [
{
"grok": {
"field": "optd_qa_por_full",
"patterns": [
"^%{DATA:reporting_reason}\\^%{OPT_WORD:iata_code}\\^%{OPT_WORD:icao_code}\\^%{OPT_WORD:faa_code}\\^%{WORD:is_geonames}\\^%{INT:geoname_id}\\^%{OPT_INT:envelope_id}\\^%{DATA:name}\\^%{DATA:asciiname}\\^%{OPT_NUMBER:coord.lat}\\^%{OPT_NUMBER:coord.lon}\\^%{FCLASS:fclass}\\^%{OPT_WORD:fcode}\\^%{OPT_NUMBER:page_rank}\\^%{OPT_DATE:date_from}\\^%{OPT_DATE:date_until}\\^%{DATA:comment}\\^%{OPT_WORD:country_code}\\^%{OPT_WORD:cc2}\\^%{DATA:country_name}\\^%{DATA:continent_name}\\^%{OPT_WORD:adm1_code}\\^%{DATA:adm1_name_utf}\\^%{DATA:adm1_name_ascii}\\^%{OPT_WORD:adm2_code}\\^%{DATA:adm2_name_utf}\\^%{DATA:adm2_name_ascii}\\^%{OPT_WORD:adm3_code}\\^%{OPT_WORD:adm4_code}\\^%{OPT_INT:population}\\^%{OPT_INT:elevation}\\^%{OPT_INT:gtopo30}\\^%{DATA:timezone}\\^%{OPT_NUMBER:gmt_offset}\\^%{OPT_NUMBER:dst_offset}\\^%{OPT_NUMBER:raw_offset}\\^%{OPT_DATE:moddate}\\^%{DATA:city_code_list}\\^%{DATA:city_name_list}\\^%{DATA:city_detail_list}\\^%{DATA:tvl_por_list}\\^%{OPT_WORD:iso31662}\\^%{OPT_WORD:location_type}\\^%{DATA:wiki_link}\\^%{DATA:alt_name_section}\\^%{OPT_WORD:wac}\\^%{DATA:wac_name}\\^%{OPT_WORD:ccy_code}\\^%{DATA:unlc_list}\\^%{DATA:uic_list}\\^%{OPT_NUMBER:geo_coord.lat}\\^%{OPT_NUMBER:geo_coord.lon}\\^%{OPT_NUMBER:distance}\\^%{OPT_NUMBER:weighted_distance}$"
],
"pattern_definitions": {
"FCLASS": "[AHLPRSTUV]",
"OPT_DATE": "(%{YEAR}-%{MONTHNUM2}-%{MONTHDAY}|-1)?",
"OPT_INT": "(%{INT})?",
"OPT_NUMBER": "(%{NUMBER})?",
"OPT_WORD": "(%{WORD})?"
}
}
},
{
"remove": {
"field": "optd_qa_por_full"
}
},
{
"set": {
"field": "is_geonames",
"if": "ctx.is_geonames == 'Y'",
"value": true
}
},
{
"set": {
"field": "is_geonames",
"if": "ctx.is_geonames == 'N'",
"value": false
}
},
{
"set": {
"field": "coord.lat",
"if": "ctx.coord.lat == ''",
"value": 0.0
}
},
{
"set": {
"field": "coord.lon",
"if": "ctx.coord.lon == ''",
"value": 0.0
}
},
{
"set": {
"field": "geo_coord.lat",
"if": "ctx.geo_coord.lat == ''",
"value": "{{coord.lat}}"
}
},
{
"set": {
"field": "geo_coord.lon",
"if": "ctx.geo_coord.lon == ''",
"value": "{{coord.lon}}"
}
},
{
"set": {
"field": "page_rank",
"if": "ctx.page_rank == ''",
"value": 0.0
}
},
{
"set": {
"field": "date_from",
"if": "ctx.date_from == '-1'",
"value": "1970-01-01"
}
},
{
"set": {
"field": "date_until",
"if": "ctx.date_until == '-1'",
"value": "2099-12-31"
}
},
{
"set": {
"field": "moddate",
"if": "ctx.moddate == '-1'",
"value": "1970-01-01"
}
},
{
"date" : {
"field" : "timestamp",
"target_field" : "timestamp",
"formats" : ["yyyy-MM-dd HH:mm:ss"],
"timezone" : "Etc/UTC"
}
}
]
}