haraka / haraka-plugin-elasticsearch

Ship Haraka log info directly to Elasticsearch
https://www.npmjs.com/package/haraka-plugin-elasticsearch
MIT License
5 stars 5 forks source link

Creating Index is not working on elasticsearch 8.1.x #43

Closed wioxjk closed 2 months ago

wioxjk commented 2 years ago

Hi, I wanted to run a elastic search server for private use, and I am having some problems creating the index. Any pointers to what I am doing wrong? Or does the index needs some updating in newer versions?

root@elastic01:~# !415
curl -k -X PUT 'https://localhost:9200/_template/haraka_results' -u elastic -H 'Content-Type: application/json' -d @index-map-template.json
Enter host password for user 'elastic':
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [haraka : {dynamic_templates=[{fail_results={mapping={type=text}, match=fail}}, {pass_results={mapping={type=text}, match=pass}}, {skip_results={mapping={type=text}, match=skip}}, {msg_results={mapping={type=text}, match=plugin.*.msg}}, {err_results={mapping={index=false, type=text}, match=err}}, {ip_addrs={mapping={type=ip}, match=ip}}, {hostnames={mapping={type=text}, match=host}}], properties={plugin={dynamic=true, type=object, enabled=true, properties={helo={type=object, properties={ips={index=false, type=text}}}, karma={type=object, properties={score={type=double}, bad={type=double}, total_connects={type=double}, neighbors={type=double}, history={type=double}, good={type=double}, connect={type=double}, connections={type=double}}}, fcrdns={type=object, properties={ptr_names={index=false, type=text}, fcrdns={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, other_ips={index=false, type=text}}}, geoip={type=object, properties={geo={type=geo_point}, distance={type=float}, org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, spamassassin={type=object, properties={headers={type=object, properties={Status={index=false, type=text}, report={index=false, type=text}}}, score={type=double}, reqd={type=double}, tests={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, line0={index=false, type=text}}}, p0f={type=object, properties={os_flavor={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, rspamd={type=object, properties={emails={index=false, type=text}, urls={index=false, type=text}, messages={index=false, type=text}}}, spf={type=object, properties={domain={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}, asn={type=object, properties={org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, asn_bad={type=double}, asn_connections={type=double}, asn_score={type=double}, asn_good={type=double}}}}}, connection={dynamic=true, type=object, enabled=true, properties={relay={type=boolean}, relaying={type=boolean}, count={type=object, properties={msg={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, rcpt={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, errors={type=integer}, trans={type=integer}}}, using_tls={type=boolean}, tls={type=boolean}, early={type=boolean}, early_talker={type=boolean}}}, message={dynamic=true, type=object, enabled=true, properties={envelope={type=object, properties={sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, recipient={type=object, properties={address={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, action={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, bytes={type=double}, header={type=object, properties={date={index=false, type=text}, resent-from={index=false, type=text}, sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, subject={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, message-id={index=false, type=text}, from={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, to={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, reply-to={index=false, type=text}, resent-header={index=false, type=text}}}, body={type=object, properties={attachment={type=object, properties={file={type=text}, ctype={type=text}, bytes={type=float}, md5={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, queue={type=object}}}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping: Root mapping definition has unsupported parameters:  [haraka : {dynamic_templates=[{fail_results={mapping={type=text}, match=fail}}, {pass_results={mapping={type=text}, match=pass}}, {skip_results={mapping={type=text}, match=skip}}, {msg_results={mapping={type=text}, match=plugin.*.msg}}, {err_results={mapping={index=false, type=text}, match=err}}, {ip_addrs={mapping={type=ip}, match=ip}}, {hostnames={mapping={type=text}, match=host}}], properties={plugin={dynamic=true, type=object, enabled=true, properties={helo={type=object, properties={ips={index=false, type=text}}}, karma={type=object, properties={score={type=double}, bad={type=double}, total_connects={type=double}, neighbors={type=double}, history={type=double}, good={type=double}, connect={type=double}, connections={type=double}}}, fcrdns={type=object, properties={ptr_names={index=false, type=text}, fcrdns={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, other_ips={index=false, type=text}}}, geoip={type=object, properties={geo={type=geo_point}, distance={type=float}, org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, spamassassin={type=object, properties={headers={type=object, properties={Status={index=false, type=text}, report={index=false, type=text}}}, score={type=double}, reqd={type=double}, tests={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, line0={index=false, type=text}}}, p0f={type=object, properties={os_flavor={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, rspamd={type=object, properties={emails={index=false, type=text}, urls={index=false, type=text}, messages={index=false, type=text}}}, spf={type=object, properties={domain={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}, asn={type=object, properties={org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, asn_bad={type=double}, asn_connections={type=double}, asn_score={type=double}, asn_good={type=double}}}}}, connection={dynamic=true, type=object, enabled=true, properties={relay={type=boolean}, relaying={type=boolean}, count={type=object, properties={msg={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, rcpt={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, errors={type=integer}, trans={type=integer}}}, using_tls={type=boolean}, tls={type=boolean}, early={type=boolean}, early_talker={type=boolean}}}, message={dynamic=true, type=object, enabled=true, properties={envelope={type=object, properties={sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, recipient={type=object, properties={address={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, action={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, bytes={type=double}, header={type=object, properties={date={index=false, type=text}, resent-from={index=false, type=text}, sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, subject={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, message-id={index=false, type=text}, from={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, to={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, reply-to={index=false, type=text}, resent-header={index=false, type=text}}}, body={type=object, properties={attachment={type=object, properties={file={type=text}, ctype={type=text}, bytes={type=float}, md5={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, queue={type=object}}}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [haraka : {dynamic_templates=[{fail_results={mapping={type=text}, match=fail}}, {pass_results={mapping={type=text}, match=pass}}, {skip_results={mapping={type=text}, match=skip}}, {msg_results={mapping={type=text}, match=plugin.*.msg}}, {err_results={mapping={index=false, type=text}, match=err}}, {ip_addrs={mapping={type=ip}, match=ip}}, {hostnames={mapping={type=text}, match=host}}], properties={plugin={dynamic=true, type=object, enabled=true, properties={helo={type=object, properties={ips={index=false, type=text}}}, karma={type=object, properties={score={type=double}, bad={type=double}, total_connects={type=double}, neighbors={type=double}, history={type=double}, good={type=double}, connect={type=double}, connections={type=double}}}, fcrdns={type=object, properties={ptr_names={index=false, type=text}, fcrdns={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, other_ips={index=false, type=text}}}, geoip={type=object, properties={geo={type=geo_point}, distance={type=float}, org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, spamassassin={type=object, properties={headers={type=object, properties={Status={index=false, type=text}, report={index=false, type=text}}}, score={type=double}, reqd={type=double}, tests={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, line0={index=false, type=text}}}, p0f={type=object, properties={os_flavor={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}}}, rspamd={type=object, properties={emails={index=false, type=text}, urls={index=false, type=text}, messages={index=false, type=text}}}, spf={type=object, properties={domain={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}, asn={type=object, properties={org={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, asn_bad={type=double}, asn_connections={type=double}, asn_score={type=double}, asn_good={type=double}}}}}, connection={dynamic=true, type=object, enabled=true, properties={relay={type=boolean}, relaying={type=boolean}, count={type=object, properties={msg={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, rcpt={type=object, properties={reject={type=integer}, tempfail={type=integer}, accept={type=integer}}}, errors={type=integer}, trans={type=integer}}}, using_tls={type=boolean}, tls={type=boolean}, early={type=boolean}, early_talker={type=boolean}}}, message={dynamic=true, type=object, enabled=true, properties={envelope={type=object, properties={sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, recipient={type=object, properties={address={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, action={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, bytes={type=double}, header={type=object, properties={date={index=false, type=text}, resent-from={index=false, type=text}, sender={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, subject={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, message-id={index=false, type=text}, from={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, to={eager_global_ordinals=false, index_phrases=false, fielddata=false, norms=true, index=true, store=false, type=text, index_options=positions}, reply-to={index=false, type=text}, resent-header={index=false, type=text}}}, body={type=object, properties={attachment={type=object, properties={file={type=text}, ctype={type=text}, bytes={type=float}, md5={eager_global_ordinals=false, norms=false, index=true, store=false, type=keyword, split_queries_on_whitespace=false, index_options=docs, doc_values=true}}}}}, queue={type=object}}}}}]"}},"status":400}root@elastic01:~#
msimerson commented 1 year ago

Yeah, index types changed in ES 8 and the old way no longer works.