Skip to content

Commit

Permalink
Merge pull request #660 from elastic/add-hidden-to-datastream
Browse files Browse the repository at this point in the history
Add hidden field to data stream
  • Loading branch information
kevinlog authored Dec 10, 2020
2 parents 9c95578 + c8b6f6a commit 8b92a02
Show file tree
Hide file tree
Showing 16 changed files with 157 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Add "traces" as legal event type. [#656](https://github.com/elastic/package-registry/pull/656)
* Add input-level `template_path` field. [#655](https://github.com/elastic/package-registry/pull/655)

* Add "hidden" field to data stream. [#660] (https://github.com/elastic/package-registry/pull/660)
### Deprecated

### Known Issue
Expand Down
2 changes: 1 addition & 1 deletion testdata/generated/categories-experimental.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"id": "custom",
"title": "Custom",
"count": 10
"count": 11
},
{
"id": "message_queue",
Expand Down
2 changes: 1 addition & 1 deletion testdata/generated/categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"id": "custom",
"title": "Custom",
"count": 10
"count": 11
},
{
"id": "message_queue",
Expand Down
42 changes: 42 additions & 0 deletions testdata/generated/package/hidden/1.0.0/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0",
"format_version": "1.0.0",
"readme": "/package/hidden/1.0.0/docs/README.md",
"license": "basic",
"categories": [
"custom"
],
"conditions": {
"kibana.version": "\u003e=7.0.0"
},
"assets": [
"/package/hidden/1.0.0/manifest.yml",
"/package/hidden/1.0.0/docs/README.md",
"/package/hidden/1.0.0/data_stream/hidden/manifest.yml",
"/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml",
"/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml"
],
"data_streams": [
{
"type": "metrics",
"dataset": "hidden.hidden",
"hidden": true,
"title": "Hidden data stream and ilm policy overrride",
"release": "experimental",
"package": "hidden",
"elasticsearch": {
"index_template.mappings": {
"dynamic": false
}
},
"path": "hidden"
}
]
}
10 changes: 10 additions & 0 deletions testdata/generated/search-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "input_level_templates",
"title": "Input level templates",
Expand Down
10 changes: 10 additions & 0 deletions testdata/generated/search-category-custom.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "input_level_templates",
"title": "Input level templates",
Expand Down
10 changes: 10 additions & 0 deletions testdata/generated/search-kibana721.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "longdocs",
"title": "Long Docs",
Expand Down
10 changes: 10 additions & 0 deletions testdata/generated/search-package-experimental.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "input_level_templates",
"title": "Input level templates",
Expand Down
10 changes: 10 additions & 0 deletions testdata/generated/search-package-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "input_level_templates",
"title": "Input level templates",
Expand Down
10 changes: 10 additions & 0 deletions testdata/generated/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"download": "/epr/foo/foo-1.0.0.zip",
"path": "/package/foo/1.0.0"
},
{
"name": "hidden",
"title": "Hidden",
"version": "1.0.0",
"release": "beta",
"description": "This is the hidden integration",
"type": "solution",
"download": "/epr/hidden/hidden-1.0.0.zip",
"path": "/package/hidden/1.0.0"
},
{
"name": "input_level_templates",
"title": "Input level templates",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: data_stream.type
type: constant_keyword
description: >
Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: >
Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: >
Data stream namespace.
- name: "@timestamp"
type: date
description: >
Event timestamp.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

- name: source
title: Source
group: 2
type: group
fields:
- name: geo.city_name
level: core
type: keyword
description: City name.
ignore_above: 1024
- name: foobar
type: text
description: A field with a pattern defined
pattern: '^[a-zA-Z]$'
6 changes: 6 additions & 0 deletions testdata/package/hidden/1.0.0/data_stream/hidden/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Hidden data stream and ilm policy overrride
type: metrics
hidden: true
elasticsearch:
index_template.mappings:
dynamic: false
Empty file.
14 changes: 14 additions & 0 deletions testdata/package/hidden/1.0.0/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
format_version: 1.0.0

name: hidden
description: This is the hidden integration
version: 1.0.0
title: Hidden
categories: ["custom"]
type: solution
release: beta

conditions:
kibana:
version: ">=7.0.0"

1 change: 1 addition & 0 deletions util/data_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type DataStream struct {
// Name and type of the data stream. This is linked to data_stream.dataset and data_stream.type fields.
Type string `config:"type" json:"type" validate:"required"`
Dataset string `config:"dataset" json:"dataset,omitempty" yaml:"dataset,omitempty"`
Hidden bool `config:"hidden" json:"hidden,omitempty" yaml:"hidden,omitempty"`

Title string `config:"title" json:"title" validate:"required"`
Release string `config:"release" json:"release"`
Expand Down

0 comments on commit 8b92a02

Please sign in to comment.