Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date_index_name processor #17973

Merged

Conversation

martijnvg
Copy link
Member

The processor added in this PR dynamically redirects a document to an index based on a provided index name prefix, a date or timestamp field in the document being processed and the provided date rounding.

PR for #17814

@martijnvg martijnvg added >feature review :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v5.0.0-alpha2 labels Apr 26, 2016
import java.util.Map;
import java.util.function.Function;

public final class DateIndexNameProcessor extends AbstractProcessor {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is overlap with what the date and this processor do. This processor needs to parse the date before it can be printed into the index name with the desired format. So there is some code duplication, but I think that is ok. An alternative would be to come up with a common base class that then the date and this processor extend from, but I wasn't too fund of the idea either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

|======
| Name | Required | Default | Description
| `field` | yes | - | The field to get the date or timestamp from.
| `index_name_prefix` | yes | - | A prefix of the index name to be prepended before the printed date.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if a user wants the index name to only be the date value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I can make that option to be not required.

@martijnvg martijnvg force-pushed the ingest_date_index_name_processor branch from b585c01 to 385b84f Compare April 29, 2016 10:09
@martijnvg
Copy link
Member Author

@talevy I made index_name_prefix an optional setting.

@talevy
Copy link
Contributor

talevy commented Apr 29, 2016

LGTM

@martijnvg martijnvg force-pushed the ingest_date_index_name_processor branch from 385b84f to b25ae4e Compare April 29, 2016 14:45
@martijnvg martijnvg force-pushed the ingest_date_index_name_processor branch from b25ae4e to 7aca138 Compare April 29, 2016 15:21
@martijnvg martijnvg merged commit 7aca138 into elastic:master Apr 29, 2016
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 15, 2016
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >feature v5.0.0-alpha3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants