8000 ⚓️ Elasticsearch Hook: Configuration of index suffix date pattern · Issue #130 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

Skip to content

⚓️ Elasticsearch Hook: Configuration of index suffix date pattern #130

@rfelber

Description

@rfelber

As a SCB User i would like to configure the elasticsearch index pattern more precisely when i install the elasticsearch persistence hook. This feature will be useful to optimize the elasticsearch result index size, rollover strategie and performance.

As for now it is already possible to configure the index prefix via the helm chart config:

# Define a specific index prefix
indexPrefix: "scbv2" 

Additionally it should be possible to configure a date pattern as suffix to change the index aggregation level:

# Define a specific index prefix
indexPrefix: "scbv2"
# Define a specific index suffix based on date pattern (YEAR, MONTH, WEEK, DATE)
indexSuffix: “YYYY-MM-DD”
# Define if the name of the namespace where this hook is deployed to must be added to the index name. The namespace can be used to separate index by tenants (namespaces).
indexAppendNamespace: true

Examples

Example index names that should be possible to configure:

  • scbv2-team-2020-10-05 (daily rollover pattern, append namespace: true)

  • scbv2-team-2020-10 (monthly rollover pattern, append namespace: true)

  • scbv2-team-2020 (yearly rollover pattern, append namespace: true)

  • scbv2-team-2020-45 (weekly rollover pattern, append namespace: true)

  • scbv2-team (no rollover pattern, append namespace: true)

  • scbv2-2020-10-05 (daily rollover pattern, append namespace: false)

  • scbv2-2020-10 (monthly rollover pattern, append namespace: false)

  • scbv2-2020 (yearly rollover pattern, append namespace: false)

  • scbv2-2020-45 (weekly rollover pattern, append namespace: false)

  • scbv2 (no rollover pattern, append namespace: false)

Where to start?

As a starting point here a pointer to the current implementation:

https://github.com/secureCodeBox/secureCodeBox-v2/blob/25b548d47795dba2891f45c7d11381ab69275ac5/hooks/persistence-elastic/hook.js#L50

Todos:

  • Update HelmChart config defaults
  • Implement feature within hook.js
  • Add additional unit tests for the different configuration options/combinations.

Metadata

Metadata

Assignees

Labels

Hacktoberfesthttps://hacktoberfest.digitalocean.com/hookImplement or update a hookpersistenceImplement or update a persistence store

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0