Convert
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
The convert processor converts a field in the event to a different type, such as converting a string to an integer.
The supported types include: integer, long, float, double, string, boolean, and ip.
The ip type is effectively an alias for string, but with an added validation that the value is an IPv4 or IPv6 address.
processors:
- convert:
fields:
- {from: "src_ip", to: "source.ip", type: "ip"}
- {from: "src_port", to: "source.port", type: "integer"}
ignore_missing: true
fail_on_error: false
The convert processor has the following configuration settings:
fields- (Required) This is the list of fields to convert. At least one item must be contained in the list. Each item in the list must have a
fromkey that specifies the source field. Thetokey is optional and specifies where to assign the converted value. Iftois omitted then thefromfield is updated in-place. Thetypekey specifies the data type to convert the value to. Iftypeis omitted then the processor copies or renames the field without any type conversion. ignore_missing- (Optional) If
truethe processor continues to the next field when thefromkey is not found in the event. If false then the processor returns an error and does not process the remaining fields. Default isfalse. fail_on_error- (Optional) If false type conversion failures are ignored and the processor continues to the next field. Default is
true. tag- (Optional) An identifier for this processor. Useful for debugging.
mode-
(Optional) When both
fromandtoare defined for a field thenmodecontrols whether tocopyorrenamethe field when the type conversion is successful. Default iscopy.