Skip to content

Add unit conversion ingest node processor #31737

Closed as not planned
Closed as not planned
@inqueue

Description

@inqueue

Describe the feature:
Working with Filebeat modules, I have come across several instances where I need to convert seconds to millis and kilobytes/megabytes/gigabytes to bytes. While the script processor is available to perform such unit conversions, a dedicated processor for this task would facilitate the development of modules greatly by eliminating the need to write and rewrite them in painless. It might look something like this:

{
  "units": {
    "field": "duration_sec",
    "from": "seconds",
    "to": "milliseconds"
  }
}

Then use rename to adjust the field name accordingly:

{
  "rename": {
    "field": "duration_sec",
    "target_field": "duration_ms"
  }
}

Even better might a processor that accepts a conversion factor or possibly formula so it could be applied to any unit of measure; e.g., temperature, speed, energy, leagues, etc.

{
  "units": {
    "field": "duration_sec",
    "factor": .001,
    "target_field": "duration_ms"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions