1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
// This file is autogenerated, DO NOT EDIT
// scripting/common-script-uses.asciidoc:173
[source, python]
----
resp = client.indices.put_mapping(
index="my-index",
runtime={
"http.response": {
"type": "long",
"script": "\n String response=dissect('%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} HTTP/%{httpversion}\" %{response} %{size}').extract(doc[\"message\"].value)?.response;\n if (response != null) emit(Integer.parseInt(response));\n "
}
},
)
print(resp)
----
|