1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// This file is autogenerated, DO NOT EDIT
// scripting/dissect-syntax.asciidoc:115
[source, python]
----
resp = client.scripts_painless_execute(
script={
"source": "\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 "
},
context="long_field",
context_setup={
"index": "my-index",
"document": {
"message": "247.37.0.0 - - [30/Apr/2020:14:31:22 -0500] \"GET /images/hm_nbg.jpg HTTP/1.0\" 304 0"
}
},
)
print(resp)
----
|