-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Behavioral Analytics] Add a final_pipeline to event data streams. (#…
- Loading branch information
Showing
18 changed files
with
774 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 95198 | ||
summary: "[Behavioral Analytics] Add a `final_pipeline` to event data streams" | ||
area: Application | ||
type: feature | ||
issues: [] |
36 changes: 36 additions & 0 deletions
36
...g/elasticsearch/xpack/entsearch/analytics/behavioral_analytics-events-final_pipeline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"description": "Built-in ingest pipeline applied by default as final pipeline to behavioral analytics event data streams.", | ||
"processors": [ | ||
{ | ||
"uri_parts": { | ||
"field": "page.url", | ||
"target_field": "page.url", | ||
"ignore_missing": true | ||
} | ||
}, | ||
{ | ||
"uri_parts": { | ||
"field": "page.referrer", | ||
"target_field": "page.referrer", | ||
"ignore_missing": true | ||
} | ||
}, | ||
{ | ||
"foreach": { | ||
"field": "search.results.items", | ||
"ignore_missing": true, | ||
"processor": { | ||
"uri_parts": { | ||
"field": "_ingest._value.page.url", | ||
"target_field": "_ingest._value.page.url", | ||
"ignore_missing": true | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"_meta": { | ||
"managed": true | ||
}, | ||
"version": ${xpack.entsearch.analytics.template.version} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...earch/src/main/java/org/elasticsearch/xpack/application/analytics/AnalyticsConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.application.analytics; | ||
|
||
public class AnalyticsConstants { | ||
|
||
private AnalyticsConstants() {} | ||
|
||
// Data stream related constants. | ||
public static final String EVENT_DATA_STREAM_DATASET = "events"; | ||
public static final String EVENT_DATA_STREAM_TYPE = "behavioral_analytics"; | ||
public static final String EVENT_DATA_STREAM_INDEX_PREFIX = EVENT_DATA_STREAM_TYPE + "-" + EVENT_DATA_STREAM_DATASET + "-"; | ||
public static final String EVENT_DATA_STREAM_INDEX_PATTERN = EVENT_DATA_STREAM_INDEX_PREFIX + "*"; | ||
|
||
// Resource config. | ||
public static final String ROOT_RESOURCE_PATH = "/org/elasticsearch/xpack/entsearch/analytics/"; | ||
|
||
// The variable to be replaced with the template version number | ||
public static final String TEMPLATE_VERSION_VARIABLE = "xpack.entsearch.analytics.template.version"; | ||
} |
53 changes: 53 additions & 0 deletions
53
...n/java/org/elasticsearch/xpack/application/analytics/AnalyticsIngestPipelineRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
package org.elasticsearch.xpack.application.analytics; | ||
|
||
import org.elasticsearch.client.internal.Client; | ||
import org.elasticsearch.cluster.service.ClusterService; | ||
import org.elasticsearch.threadpool.ThreadPool; | ||
import org.elasticsearch.xpack.application.utils.ingest.PipelineRegistry; | ||
import org.elasticsearch.xpack.application.utils.ingest.PipelineTemplateConfiguration; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.elasticsearch.xpack.application.analytics.AnalyticsConstants.EVENT_DATA_STREAM_INDEX_PREFIX; | ||
import static org.elasticsearch.xpack.application.analytics.AnalyticsConstants.ROOT_RESOURCE_PATH; | ||
import static org.elasticsearch.xpack.application.analytics.AnalyticsConstants.TEMPLATE_VERSION_VARIABLE; | ||
import static org.elasticsearch.xpack.application.analytics.AnalyticsTemplateRegistry.REGISTRY_VERSION; | ||
import static org.elasticsearch.xpack.core.ClientHelper.ENT_SEARCH_ORIGIN; | ||
|
||
/** | ||
* Set up the behavioral analytics ingest pipelines. | ||
*/ | ||
public class AnalyticsIngestPipelineRegistry extends PipelineRegistry { | ||
|
||
// Ingest pipelines configuration. | ||
static final String EVENT_DATA_STREAM_INGEST_PIPELINE_NAME = EVENT_DATA_STREAM_INDEX_PREFIX + "final_pipeline"; | ||
static final List<PipelineTemplateConfiguration> INGEST_PIPELINES = Collections.singletonList( | ||
new PipelineTemplateConfiguration( | ||
EVENT_DATA_STREAM_INGEST_PIPELINE_NAME, | ||
ROOT_RESOURCE_PATH + EVENT_DATA_STREAM_INGEST_PIPELINE_NAME + ".json", | ||
REGISTRY_VERSION, | ||
TEMPLATE_VERSION_VARIABLE | ||
) | ||
); | ||
|
||
public AnalyticsIngestPipelineRegistry(ClusterService clusterService, ThreadPool threadPool, Client client) { | ||
super(clusterService, threadPool, client); | ||
} | ||
|
||
@Override | ||
protected String getOrigin() { | ||
return ENT_SEARCH_ORIGIN; | ||
} | ||
|
||
@Override | ||
protected List<PipelineTemplateConfiguration> getIngestPipelineConfigs() { | ||
return INGEST_PIPELINES; | ||
} | ||
} |
Oops, something went wrong.