Skip to content

Instantly share code, notes, and snippets.

@yoshikaw
Created December 10, 2015 12:14
Show Gist options
  • Save yoshikaw/edf8b2e903f57dfe07ad to your computer and use it in GitHub Desktop.
Save yoshikaw/edf8b2e903f57dfe07ad to your computer and use it in GitHub Desktop.
○クッキーの値
key1=aaa; key2=bbb; key3=ccc
○embulk.yml(抜粋)
- type: column
add_columns:
- {name: cookie_key1: src: cookie}
- {name: cookie_key2: src: cookie}
- {name: cookie_key3: src: cookie}
- type: eval
eval_columns:
- cookie_key1: if /key1=([^;]+)/ =~ value then
value = $1
else
value = nil
end
- cookie_key2: (snip)
○マッピング(抜粋)
"properties": {
"cookie_key1": {
"index": "not_analyzed",
"type": "string"
},
"cookie_key2": {
"index": "not_analyzed",
"type": "string"
},
○やりたかったこと
上記マッピング定義ではなく以下のように定義して、Kibana からは、通常は cookie でアナライズされた cookie 全体、
key1 に着目したい時だけで cookie.key1 のような形で検索でればいいかなーと。
"properties": {
"cookie": {
"type": "multi_field",
"fields": {
"{name}": {
"type": "string",
"index": "analyzed"
},
"key1": {
"type": "string",
"index": "not_analyzed"
},
"key2": {
"type": "string",
"index": "not_analyzed"
},
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment