Skip to content

Commit 1a5ef2f

Browse files
author
Paul
committed
Merge branch 'hook/#130-elastic-search-indexing' of github.com:secureCodeBox/secureCodeBox into origin/hook/130-elastic-search-indexing
2 parents 5a32eba + 7050999 commit 1a5ef2f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hooks/persistence-elastic/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ helm upgrade --install elkh secureCodeBox/persistence-elastic
4040
| image.repository | string | `"docker.io/securecodebox/persistence-elastic"` | Image repository for the dashboard importer job |
4141
| image.tag | string | defaults to the charts version | Image tag for the dashboard importer job |
4242
| imagePullSecrets | list | `[]` | |
43+
| indexAppendNamespace | bool | `true` | 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). |
4344
| indexPrefix | string | `"scbv2"` | Define a specific index prefix used for all elasticsearch indices. |
45+
| indexSuffix | string | `"“YYYY-MM-DD”"` | Define a specific index suffix based on date pattern (YEAR (YYYY), MONTH (YYYY-MM), WEEK (YYYY-Www), DATE (YYYY-MM-DD)) |
4446
| kibana | object | `{"enabled":true}` | Configures included Elasticsearch subchart |
4547
| kibana.enabled | bool | `true` | Enable if you want to deploy an kibana service (see: https://github.com/elastic/helm-charts/tree/master/kibana) |
4648
| nameOverride | string | `""` | |

hooks/persistence-elastic/hook.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ test("should send findings to elasticsearch with given prefix", async () => {
8181
body: [
8282
{
8383
index: {
84-
_index: `myPrefix_default_${testDate.toISOString().substr(0, 10)}`,
84+
_index: `myPrefix_default_2020-11-11`,
8585
},
8686
},
8787
{
@@ -125,7 +125,7 @@ test("should not append namespace if 'appendNamespace' is null", async () => {
125125
});
126126
});
127127

128-
test("should append date format YYYY", async () => {
128+
test("should append date format yyyy", async () => {
129129
const findings = [];
130130

131131
const getFindings = async () => findings;
@@ -149,7 +149,7 @@ test("should append date format YYYY", async () => {
149149
});
150150
});
151151

152-
test("should append week format like YYYY/[W]w -> 2020/W46", async () => {
152+
test("should append week format like yyyy/'W'W -> 2020/W46", async () => {
153153
const findings = [];
154154

155155
const getFindings = async () => findings;

0 commit comments

Comments
 (0)