diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ad6c5ed4..488e98d1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* Prepare stub for Storage Indexer. Disable fetching packages from Package Storage v1. [#811](https://github.com/elastic/package-registry/pull/811)
+* Support input packages. [#809](https://github.com/elastic/package-registry/pull/809)
### Deprecated
diff --git a/config.yml b/config.yml
index 68741c79e..4ab550621 100644
--- a/config.yml
+++ b/config.yml
@@ -1,4 +1,3 @@
package_paths:
- ./testdata/package
- ./testdata/local-storage
- - ./build/package-storage/packages
diff --git a/indexer.go b/indexer.go
index 8c0da1406..2568b3acb 100644
--- a/indexer.go
+++ b/indexer.go
@@ -18,7 +18,7 @@ type Indexer interface {
type CombinedIndexer []Indexer
func NewCombinedIndexer(indexers ...Indexer) CombinedIndexer {
- return CombinedIndexer(indexers)
+ return indexers
}
func (c CombinedIndexer) Init(ctx context.Context) error {
diff --git a/magefile.go b/magefile.go
index 3c30bd022..c9726a03f 100644
--- a/magefile.go
+++ b/magefile.go
@@ -27,9 +27,7 @@ var (
// GoLicenserImportPath controls the import path used to install go-licenser.
GoLicenserImportPath = "github.com/elastic/go-licenser"
- buildDir = "./build"
- storageRepoDir = filepath.Join(buildDir, "package-storage")
- packagePaths = []string{filepath.Join(storageRepoDir, "packages"), "./testdata/package/"}
+ buildDir = "./build"
)
func Build() error {
@@ -39,9 +37,6 @@ func Build() error {
func Check() error {
Format()
- // Setup the variables for the tests and not create tarGz files
- packagePaths = []string{"testdata/package"}
-
err := Build()
if err != nil {
return err
diff --git a/main_test.go b/main_test.go
index 614302dfd..2d59edee6 100644
--- a/main_test.go
+++ b/main_test.go
@@ -86,6 +86,9 @@ func TestEndpoints(t *testing.T) {
{"/search?prerelease=true", "/search", "search-package-prerelease.json", searchHandler(indexer, testCacheTime)},
{"/search?prerelease=foo", "/search", "search-package-prerelease-error.txt", searchHandler(indexer, testCacheTime)},
{"/search?category=datastore&prerelease=true", "/search", "search-category-datastore-prerelease.json", searchHandler(indexer, testCacheTime)},
+ {"/search?type=input&prerelease=true", "/search", "search-input-packages.json", searchHandler(indexer, testCacheTime)},
+ {"/search?type=input&package=integration_input&prerelease=true", "/search", "search-input-integration-package.json", searchHandler(indexer, testCacheTime)},
+ {"/search?type=integration&package=integration_input&prerelease=true", "/search", "search-integration-integration-package.json", searchHandler(indexer, testCacheTime)},
{"/favicon.ico", "", "favicon.ico", faviconHandleFunc},
// Removed flags, kept to ensure that they don't break requests from old versions.
@@ -323,6 +326,7 @@ func TestPackageIndex(t *testing.T) {
{"/package/missing/1.0.0/", packageIndexRouterPath, "index-package-not-found.txt", packageIndexHandler},
{"/package/example/999.0.0/", packageIndexRouterPath, "index-package-revision-not-found.txt", packageIndexHandler},
{"/package/example/a.b.c/", packageIndexRouterPath, "index-package-invalid-version.txt", packageIndexHandler},
+ {"/package/sql_input/1.0.1/", packageIndexRouterPath, "sql-input-package.json", packageIndexHandler},
}
for _, test := range tests {
diff --git a/packages/package.go b/packages/package.go
index 51c45cbd7..10a2046a2 100644
--- a/packages/package.go
+++ b/packages/package.go
@@ -105,12 +105,17 @@ type PolicyTemplate struct {
Title string `config:"title" json:"title" validate:"required"`
Description string `config:"description" json:"description" validate:"required"`
DataStreams []string `config:"data_streams,omitempty" json:"data_streams,omitempty" yaml:"data_streams,omitempty"`
- Inputs []Input `config:"inputs" json:"inputs"`
+ Inputs []Input `config:"inputs" json:"inputs,omitempty" yaml:"inputs,omitempty"`
Multiple *bool `config:"multiple" json:"multiple,omitempty" yaml:"multiple,omitempty"`
Icons []Image `config:"icons,omitempty" json:"icons,omitempty" yaml:"icons,omitempty"`
Categories []string `config:"categories,omitempty" json:"categories,omitempty" yaml:"categories,omitempty"`
Screenshots []Image `config:"screenshots,omitempty" json:"screenshots,omitempty" yaml:"screenshots,omitempty"`
Readme *string `config:"readme,omitempty" json:"readme,omitempty" yaml:"readme,omitempty"`
+
+ // For purposes of "input packages"
+ Type string `config:"type,omitempty" json:"type,omitempty" yaml:"type,omitempty"`
+ Input string `config:"input,omitempty" json:"input,omitempty" yaml:"input,omitempty"`
+ TemplatePath string `config:"template_path,omitempty" json:"template_path,omitempty" yaml:"template_path,omitempty"`
}
type Conditions struct {
diff --git a/packages/packages.go b/packages/packages.go
index 2b9306096..c8c526bfc 100644
--- a/packages/packages.go
+++ b/packages/packages.go
@@ -254,6 +254,7 @@ type Filter struct {
KibanaVersion *semver.Version
PackageName string
PackageVersion string
+ PackageType string
// Deprecated, release tags to be removed.
Experimental bool
@@ -295,6 +296,10 @@ func (f *Filter) Apply(ctx context.Context, packages Packages) Packages {
continue
}
+ if f.PackageType != "" && f.PackageType != p.Type {
+ continue
+ }
+
addPackage := true
if !f.AllVersions {
// Check if the version exists and if it should be added or not.
diff --git a/search.go b/search.go
index 04ce2b7fc..2095e3ac0 100644
--- a/search.go
+++ b/search.go
@@ -73,6 +73,10 @@ func newSearchFilterFromQuery(query url.Values) (*packages.Filter, error) {
filter.PackageName = v
}
+ if v := query.Get("type"); v != "" {
+ filter.PackageType = v
+ }
+
if v := query.Get("all"); v != "" {
// Default is false, also on error
filter.AllVersions, err = strconv.ParseBool(v)
diff --git a/testdata/generated/categories-experimental.json b/testdata/generated/categories-experimental.json
index 6cf50b8ea..4f7ced278 100644
--- a/testdata/generated/categories-experimental.json
+++ b/testdata/generated/categories-experimental.json
@@ -27,12 +27,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 14
+ "count": 16
},
{
"id": "datastore",
"title": "Datastore",
- "count": 1
+ "count": 3
},
{
"id": "message_queue",
diff --git a/testdata/generated/categories-include-policy-templates.json b/testdata/generated/categories-include-policy-templates.json
index a612caf29..6a758de98 100644
--- a/testdata/generated/categories-include-policy-templates.json
+++ b/testdata/generated/categories-include-policy-templates.json
@@ -12,12 +12,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 12
+ "count": 13
},
{
"id": "datastore",
"title": "Datastore",
- "count": 2
+ "count": 3
},
{
"id": "web",
diff --git a/testdata/generated/categories-kibana652.json b/testdata/generated/categories-kibana652.json
index 8d00c0c0a..350fc70fe 100644
--- a/testdata/generated/categories-kibana652.json
+++ b/testdata/generated/categories-kibana652.json
@@ -12,7 +12,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 6
+ "count": 7
+ },
+ {
+ "id": "datastore",
+ "title": "Datastore",
+ "count": 1
},
{
"id": "message_queue",
diff --git a/testdata/generated/categories-prerelease-kibana652.json b/testdata/generated/categories-prerelease-kibana652.json
index 8d00c0c0a..350fc70fe 100644
--- a/testdata/generated/categories-prerelease-kibana652.json
+++ b/testdata/generated/categories-prerelease-kibana652.json
@@ -12,7 +12,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 6
+ "count": 7
+ },
+ {
+ "id": "datastore",
+ "title": "Datastore",
+ "count": 1
},
{
"id": "message_queue",
diff --git a/testdata/generated/categories-prerelease.json b/testdata/generated/categories-prerelease.json
index 5ffe84538..5ab8bbe5d 100644
--- a/testdata/generated/categories-prerelease.json
+++ b/testdata/generated/categories-prerelease.json
@@ -27,12 +27,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 14
+ "count": 16
},
{
"id": "datastore",
"title": "Datastore",
- "count": 1
+ "count": 3
},
{
"id": "message_queue",
diff --git a/testdata/generated/categories.json b/testdata/generated/categories.json
index af43fda86..85a1c590b 100644
--- a/testdata/generated/categories.json
+++ b/testdata/generated/categories.json
@@ -12,7 +12,12 @@
{
"id": "custom",
"title": "Custom",
- "count": 12
+ "count": 13
+ },
+ {
+ "id": "datastore",
+ "title": "Datastore",
+ "count": 1
},
{
"id": "web",
diff --git a/testdata/generated/package/integration_input/1.0.0/index.json b/testdata/generated/package/integration_input/1.0.0/index.json
new file mode 100644
index 000000000..761e9e749
--- /dev/null
+++ b/testdata/generated/package/integration_input/1.0.0/index.json
@@ -0,0 +1,99 @@
+{
+ "name": "integration_input",
+ "title": "Integration input",
+ "version": "1.0.0",
+ "release": "ga",
+ "description": "This is the example integration",
+ "type": "integration",
+ "download": "/epr/integration_input/integration_input-1.0.0.zip",
+ "path": "/package/integration_input/1.0.0",
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "ruflin"
+ },
+ "categories": [
+ "crm",
+ "azure"
+ ],
+ "format_version": "1.0.0",
+ "readme": "/package/integration_input/1.0.0/docs/README.md",
+ "license": "basic",
+ "screenshots": [
+ {
+ "src": "/img/kibana-envoyproxy.jpg",
+ "path": "/package/integration_input/1.0.0/img/kibana-envoyproxy.jpg",
+ "title": "IP Tables Ubiquity Dashboard",
+ "size": "1492x1464",
+ "type": "image/png"
+ }
+ ],
+ "assets": [
+ "/package/integration_input/1.0.0/manifest.yml",
+ "/package/integration_input/1.0.0/docs/README.md",
+ "/package/integration_input/1.0.0/img/icon.png",
+ "/package/integration_input/1.0.0/img/kibana-envoyproxy.jpg",
+ "/package/integration_input/1.0.0/data_stream/foo/manifest.yml",
+ "/package/integration_input/1.0.0/kibana/dashboard/0c610510-5cbd-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/kibana/visualization/0a994af0-5c9d-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/kibana/visualization/36f872a0-5c03-11e9-85b4-19d0072eb4f2.json",
+ "/package/integration_input/1.0.0/kibana/visualization/38f96190-5c99-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/kibana/visualization/7e4084e0-5c99-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/kibana/visualization/80844540-5c97-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/kibana/visualization/ab48c3f0-5ca6-11e9-8477-077ec9664dbd.json",
+ "/package/integration_input/1.0.0/data_stream/foo/fields/base-fields.yml",
+ "/package/integration_input/1.0.0/data_stream/foo/agent/stream/stream.yml.hbs",
+ "/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-entry.json",
+ "/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-http.json",
+ "/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-json.json",
+ "/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-plaintext.json",
+ "/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-tcp.json"
+ ],
+ "policy_templates": [
+ {
+ "name": "logs",
+ "title": "Logs datasource",
+ "description": "Datasource for your log files.",
+ "inputs": [
+ {
+ "type": "foo"
+ }
+ ],
+ "multiple": true,
+ "categories": [
+ "datastore"
+ ]
+ }
+ ],
+ "data_streams": [
+ {
+ "type": "logs",
+ "dataset": "integration_input.foo",
+ "title": "Foo",
+ "release": "ga",
+ "ingest_pipeline": "pipeline-entry",
+ "streams": [
+ {
+ "input": "foo",
+ "vars": [
+ {
+ "name": "paths",
+ "type": "text",
+ "description": "Path to log files to be collected",
+ "multi": true,
+ "required": true,
+ "show_user": false
+ }
+ ],
+ "template_path": "stream.yml.hbs",
+ "enabled": true
+ }
+ ],
+ "package": "integration_input",
+ "path": "foo"
+ }
+ ]
+}
diff --git a/testdata/generated/package/integration_input/1.0.2/index.json b/testdata/generated/package/integration_input/1.0.2/index.json
new file mode 100644
index 000000000..4fcd28111
--- /dev/null
+++ b/testdata/generated/package/integration_input/1.0.2/index.json
@@ -0,0 +1,61 @@
+{
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ],
+ "format_version": "1.0.0",
+ "readme": "/package/integration_input/1.0.2/docs/README.md",
+ "license": "basic",
+ "screenshots": [
+ {
+ "src": "/img/sample-screenshot.png",
+ "path": "/package/integration_input/1.0.2/img/sample-screenshot.png",
+ "title": "Sample screenshot",
+ "size": "600x600",
+ "type": "image/png"
+ }
+ ],
+ "assets": [
+ "/package/integration_input/1.0.2/changelog.yml",
+ "/package/integration_input/1.0.2/manifest.yml",
+ "/package/integration_input/1.0.2/docs/README.md",
+ "/package/integration_input/1.0.2/fields/input.yml",
+ "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "/package/integration_input/1.0.2/img/sample-screenshot.png",
+ "/package/integration_input/1.0.2/agent/input/input.yml.hbs"
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics.",
+ "multiple": true,
+ "type": "metrics",
+ "input": "sql",
+ "template_path": "input.yml.hbs"
+ }
+ ]
+}
diff --git a/testdata/generated/package/sql_input/0.2.0/index.json b/testdata/generated/package/sql_input/0.2.0/index.json
new file mode 100644
index 000000000..0c524211d
--- /dev/null
+++ b/testdata/generated/package/sql_input/0.2.0/index.json
@@ -0,0 +1,56 @@
+{
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.2.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.2.0.zip",
+ "path": "/package/sql_input/0.2.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.2.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ],
+ "format_version": "1.0.0",
+ "readme": "/package/sql_input/0.2.0/docs/README.md",
+ "license": "basic",
+ "screenshots": [
+ {
+ "src": "/img/sample-screenshot.png",
+ "path": "/package/sql_input/0.2.0/img/sample-screenshot.png",
+ "title": "Sample screenshot",
+ "size": "600x600",
+ "type": "image/png"
+ }
+ ],
+ "assets": [
+ "/package/sql_input/0.2.0/changelog.yml",
+ "/package/sql_input/0.2.0/manifest.yml",
+ "/package/sql_input/0.2.0/docs/README.md",
+ "/package/sql_input/0.2.0/fields/input.yml",
+ "/package/sql_input/0.2.0/img/sample-logo.svg",
+ "/package/sql_input/0.2.0/img/sample-screenshot.png",
+ "/package/sql_input/0.2.0/agent/input/input.yml.hbs"
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics.",
+ "multiple": true,
+ "type": "metrics",
+ "input": "sql",
+ "template_path": "input.yml.hbs"
+ }
+ ]
+}
diff --git a/testdata/generated/package/sql_input/0.3.0/index.json b/testdata/generated/package/sql_input/0.3.0/index.json
new file mode 100644
index 000000000..07c130f60
--- /dev/null
+++ b/testdata/generated/package/sql_input/0.3.0/index.json
@@ -0,0 +1,56 @@
+{
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ],
+ "format_version": "1.0.0",
+ "readme": "/package/sql_input/0.3.0/docs/README.md",
+ "license": "basic",
+ "screenshots": [
+ {
+ "src": "/img/sample-screenshot.png",
+ "path": "/package/sql_input/0.3.0/img/sample-screenshot.png",
+ "title": "Sample screenshot",
+ "size": "600x600",
+ "type": "image/png"
+ }
+ ],
+ "assets": [
+ "/package/sql_input/0.3.0/changelog.yml",
+ "/package/sql_input/0.3.0/manifest.yml",
+ "/package/sql_input/0.3.0/docs/README.md",
+ "/package/sql_input/0.3.0/fields/input.yml",
+ "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "/package/sql_input/0.3.0/img/sample-screenshot.png",
+ "/package/sql_input/0.3.0/agent/input/input.yml.hbs"
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics.",
+ "multiple": true,
+ "type": "metrics",
+ "input": "sql",
+ "template_path": "input.yml.hbs"
+ }
+ ]
+}
diff --git a/testdata/generated/search-all.json b/testdata/generated/search-all.json
index 37fba48a9..f053fcaa3 100644
--- a/testdata/generated/search-all.json
+++ b/testdata/generated/search-all.json
@@ -180,6 +180,74 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
+ {
+ "name": "integration_input",
+ "title": "Integration input",
+ "version": "1.0.0",
+ "release": "ga",
+ "description": "This is the example integration",
+ "type": "integration",
+ "download": "/epr/integration_input/integration_input-1.0.0.zip",
+ "path": "/package/integration_input/1.0.0",
+ "policy_templates": [
+ {
+ "name": "logs",
+ "title": "Logs datasource",
+ "description": "Datasource for your log files.",
+ "categories": [
+ "datastore"
+ ]
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "ruflin"
+ },
+ "categories": [
+ "crm",
+ "azure"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
diff --git a/testdata/generated/search-category-custom.json b/testdata/generated/search-category-custom.json
index 91ed410dc..3c2e09d3d 100644
--- a/testdata/generated/search-category-custom.json
+++ b/testdata/generated/search-category-custom.json
@@ -116,6 +116,42 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
diff --git a/testdata/generated/search-category-datastore-prerelease.json b/testdata/generated/search-category-datastore-prerelease.json
index 4380de9d3..254ce6900 100644
--- a/testdata/generated/search-category-datastore-prerelease.json
+++ b/testdata/generated/search-category-datastore-prerelease.json
@@ -69,5 +69,72 @@
"azure",
"cloud"
]
+ },
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
+ {
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
}
]
diff --git a/testdata/generated/search-category-datastore.json b/testdata/generated/search-category-datastore.json
index 4380de9d3..254ce6900 100644
--- a/testdata/generated/search-category-datastore.json
+++ b/testdata/generated/search-category-datastore.json
@@ -69,5 +69,72 @@
"azure",
"cloud"
]
+ },
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
+ {
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
}
]
diff --git a/testdata/generated/search-input-integration-package.json b/testdata/generated/search-input-integration-package.json
new file mode 100644
index 000000000..3c2fc9387
--- /dev/null
+++ b/testdata/generated/search-input-integration-package.json
@@ -0,0 +1,38 @@
+[
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ }
+]
diff --git a/testdata/generated/search-input-packages.json b/testdata/generated/search-input-packages.json
new file mode 100644
index 000000000..63fa97f2c
--- /dev/null
+++ b/testdata/generated/search-input-packages.json
@@ -0,0 +1,69 @@
+[
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
+ {
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ }
+]
diff --git a/testdata/generated/search-integration-integration-package.json b/testdata/generated/search-integration-integration-package.json
new file mode 100644
index 000000000..cee9802bf
--- /dev/null
+++ b/testdata/generated/search-integration-integration-package.json
@@ -0,0 +1,34 @@
+[
+ {
+ "name": "integration_input",
+ "title": "Integration input",
+ "version": "1.0.0",
+ "release": "ga",
+ "description": "This is the example integration",
+ "type": "integration",
+ "download": "/epr/integration_input/integration_input-1.0.0.zip",
+ "path": "/package/integration_input/1.0.0",
+ "policy_templates": [
+ {
+ "name": "logs",
+ "title": "Logs datasource",
+ "description": "Datasource for your log files.",
+ "categories": [
+ "datastore"
+ ]
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "ruflin"
+ },
+ "categories": [
+ "crm",
+ "azure"
+ ]
+ }
+]
diff --git a/testdata/generated/search-package-experimental.json b/testdata/generated/search-package-experimental.json
index 8592c4bc2..3a498f816 100644
--- a/testdata/generated/search-package-experimental.json
+++ b/testdata/generated/search-package-experimental.json
@@ -301,6 +301,42 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
@@ -464,6 +500,37 @@
"web"
]
},
+ {
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "yamlpipeline",
"title": "Yaml Pipeline package",
diff --git a/testdata/generated/search-package-internal.json b/testdata/generated/search-package-internal.json
index 0466859a5..63c3e149a 100644
--- a/testdata/generated/search-package-internal.json
+++ b/testdata/generated/search-package-internal.json
@@ -148,6 +148,42 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
diff --git a/testdata/generated/search-package-prerelease.json b/testdata/generated/search-package-prerelease.json
index 821c78a81..9a5ecd2bf 100644
--- a/testdata/generated/search-package-prerelease.json
+++ b/testdata/generated/search-package-prerelease.json
@@ -301,6 +301,42 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
@@ -443,6 +479,37 @@
"web"
]
},
+ {
+ "name": "sql_input",
+ "title": "SQL Input",
+ "version": "0.3.0",
+ "release": "beta",
+ "description": "Execute custom queries against an SQL database and store the results in Elasticsearch.",
+ "type": "input",
+ "download": "/epr/sql_input/sql_input-0.3.0.zip",
+ "path": "/package/sql_input/0.3.0",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/sql_input/0.3.0/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "yamlpipeline",
"title": "Yaml Pipeline package",
diff --git a/testdata/generated/search.json b/testdata/generated/search.json
index 0466859a5..63c3e149a 100644
--- a/testdata/generated/search.json
+++ b/testdata/generated/search.json
@@ -148,6 +148,42 @@
"custom"
]
},
+ {
+ "name": "integration_input",
+ "title": "Integration Input",
+ "version": "1.0.2",
+ "release": "ga",
+ "description": "Sample package that was an integration and got migrated to input",
+ "type": "input",
+ "download": "/epr/integration_input/integration_input-1.0.2.zip",
+ "path": "/package/integration_input/1.0.2",
+ "icons": [
+ {
+ "src": "/img/sample-logo.svg",
+ "path": "/package/integration_input/1.0.2/img/sample-logo.svg",
+ "type": "image/svg+xml"
+ }
+ ],
+ "policy_templates": [
+ {
+ "name": "sql_query",
+ "title": "SQL Query",
+ "description": "Query the database to capture metrics."
+ }
+ ],
+ "conditions": {
+ "kibana": {
+ "version": "^8.4.0"
+ }
+ },
+ "owner": {
+ "github": "elastic/integrations"
+ },
+ "categories": [
+ "custom",
+ "datastore"
+ ]
+ },
{
"name": "longdocs",
"title": "Long Docs",
diff --git a/testdata/generated/sql-input-package.json b/testdata/generated/sql-input-package.json
new file mode 100644
index 000000000..9ad9fb8cf
--- /dev/null
+++ b/testdata/generated/sql-input-package.json
@@ -0,0 +1 @@
+package revision not found
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/agent/stream/stream.yml.hbs b/testdata/package/integration_input/1.0.0/data_stream/foo/agent/stream/stream.yml.hbs
new file mode 100644
index 000000000..20e9ff3fe
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/agent/stream/stream.yml.hbs
@@ -0,0 +1 @@
+foo: bar
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-entry.json b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-entry.json
new file mode 100644
index 000000000..9a0801c31
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-entry.json
@@ -0,0 +1,42 @@
+{
+ "description": "Pipeline for normalizing envoyproxy logs",
+ "processors": [
+ {
+ "pipeline": {
+ "if": "ctx.message.charAt(0) != (char)(\"{\")",
+ "name": "{{IngestPipeline 'pipeline-plaintext' }}"
+ }
+ },
+ {
+ "pipeline": {
+ "if": "ctx.message.charAt(0) == (char)(\"{\")",
+ "name": "{{IngestPipeline 'pipeline-json' }}"
+ }
+ },
+ {
+ "set": {
+ "field": "event.created",
+ "value": "{{@timestamp}}"
+ }
+ },
+ {
+ "set": {
+ "field": "@timestamp",
+ "value": "{{timestamp}}",
+ "if": "ctx.timestamp != null"
+ }
+ },
+ {
+ "remove": {
+ "field": ["timestamp"],
+ "ignore_failure": true
+ }
+ }
+ ],
+ "on_failure" : [{
+ "set" : {
+ "field" : "error.message",
+ "value" : "pipeline-entry: {{ _ingest.on_failure_message }}"
+ }
+ }]
+}
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-http.json b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-http.json
new file mode 100644
index 000000000..e38875cfe
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-http.json
@@ -0,0 +1,94 @@
+{
+ "description": "Pipeline for normalizing envoy HTTP ACCESS logs",
+ "processors": [
+ {
+ "script": {
+ "lang": "painless",
+ "source": "ctx['http'] = new HashMap(); def p = ctx.proto.indexOf ('/'); def l = ctx.proto.length(); ctx.http.version = ctx.proto.substring(p+1, l);",
+ "ignore_failure" : true
+ }
+ },
+ {
+ "rename": {
+ "field": "method",
+ "target_field": "http.request.method"
+ }
+ },
+ {
+ "rename": {
+ "field": "path",
+ "target_field": "url.path"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "response_code",
+ "type": "long"
+ }
+ },
+ {
+ "rename": {
+ "field": "response_code",
+ "target_field": "http.response.status_code"
+ }
+ },
+ {
+ "rename": {
+ "field": "bytes_received",
+ "target_field": "http.response.body.bytes"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "http.response.body.bytes",
+ "type": "long"
+ }
+ },
+ {
+ "rename": {
+ "field": "bytes_sent",
+ "target_field": "http.request.body.bytes"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "http.request.body.bytes",
+ "type": "long"
+ }
+ },
+ {
+ "script": {
+ "lang": "painless",
+ "source": "ctx.envoyproxy.upstream_service_time = Math.round(Double.parseDouble(ctx.upstream_service_time) * params.scale)",
+ "params": {
+ "scale": 1000000
+ },
+ "if": "ctx.upstream_service_time != null && ctx.upstream_service_time != '-'"
+ }
+ },
+ {
+ "set": {
+ "field": "envoyproxy.proxy_type",
+ "value": "http"
+ }
+ },
+ {
+ "set": {
+ "field": "url.domain",
+ "value": "{{envoyproxy.authority}}"
+ }
+ },
+ {
+ "user_agent": {
+ "field": "user_agent.original",
+ "ignore_missing": true
+ }
+ }
+ ],
+ "on_failure" : [{
+ "set" : {
+ "field" : "error.message",
+ "value" : "pipeline-http: {{ _ingest.on_failure_message }}"
+ }
+ }]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-json.json b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-json.json
new file mode 100644
index 000000000..763ec6690
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-json.json
@@ -0,0 +1,47 @@
+{
+ "description": "Pipeline for normalizing envoyproxy access logs",
+ "processors": [
+ {
+ "json" : {
+ "field" : "message",
+ "target_field" : "json"
+ }
+ },
+ {
+ "remove": {
+ "field": ["message"],
+ "ignore_failure" : true
+ }
+ },
+ {
+ "rename": {
+ "field": "json.message",
+ "target_field": "message",
+ "ignore_failure" : true
+ }
+ },
+ {
+ "rename": {
+ "field": "json.kubernetes",
+ "target_field": "kubernetes",
+ "ignore_failure" : true
+ }
+ },
+ {
+ "remove": {
+ "field": ["json"]
+ }
+ },
+ {
+ "pipeline": {
+ "name": "{{IngestPipeline 'pipeline-plaintext' }}"
+ }
+ }
+ ],
+ "on_failure" : [{
+ "set" : {
+ "field" : "error.message",
+ "value" : "pipeline-json: {{ _ingest.on_failure_message }}"
+ }
+ }]
+}
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-plaintext.json b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-plaintext.json
new file mode 100644
index 000000000..5468ce1da
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-plaintext.json
@@ -0,0 +1,124 @@
+{
+ "description": "Pipeline for normalizing envoy access logs",
+ "processors": [
+ {
+ "script": {
+ "lang": "painless",
+ "source": "if (ctx.message.charAt(0) == (char)(\"[\")) { ctx.temp_message = \"ACCESS \" + ctx.message;} else if (ctx.message.substring(0, 7) == \"ACCESS \") { ctx.temp_message = ctx.message;} else { throw new Exception(\"Not a valid envoyproxy access log\");}"
+ }
+ },
+ {
+ "dissect": {
+ "field": "temp_message",
+ "pattern": "%{envoyproxy.log_type} [%{timestamp}] \"%{method} %{path} %{proto}\" %{response_code} %{envoyproxy.response_flags} %{bytes_received} %{bytes_sent} %{duration} %{upstream_service_time} \"%{source.address}\" \"%{user_agent.original}\" \"%{envoyproxy.request_id}\" \"%{envoyproxy.authority}\" \"%{dest}\"",
+ "on_failure" : [{
+ "script": {
+ "lang": "painless",
+ "source": "ctx.remove('temp_message'); throw new Exception(\"Dissect error: Not a valid envoyproxy access log\");"
+ }
+ }]
+ }
+ },
+ {
+ "script": {
+ "lang": "painless",
+ "source": "if (ctx.dest == \"-\") { ctx.remove('dest');} else { ctx['destination'] = new HashMap(); def p = ctx.dest.indexOf (':'); def l = ctx.dest.length(); ctx.destination.address = ctx.dest.substring(0, p); ctx.destination.port = ctx.dest.substring(p+1, l);} ctx.remove('dest');",
+ "if": "ctx.dest != null"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "destination.port",
+ "type": "integer",
+ "if": "ctx.destination?.port != null"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "duration",
+ "type": "double",
+ "if": "ctx.duration != null"
+ }
+ },
+ {
+ "script": {
+ "lang": "painless",
+ "source": "ctx.event.duration = Math.round(ctx.duration * params.scale)",
+ "params": {
+ "scale": 1000000
+ },
+ "if": "ctx.duration != null"
+ }
+ },
+ {
+ "remove": {
+ "field": ["json", "duration", "time", "temp_message"],
+ "ignore_missing": true
+ }
+ },
+ {
+ "pipeline": {
+ "if": "ctx.proto.charAt(0) != (char)(\"-\")",
+ "name": "{{IngestPipeline 'pipeline-http' }}"
+ }
+ },
+ {
+ "pipeline": {
+ "if": "ctx.proto.charAt(0) == (char)(\"-\")",
+ "name": "{{IngestPipeline 'pipeline-tcp' }}"
+ }
+ },
+ {
+ "remove": {
+ "field": ["proto", "upstream_service_time"],
+ "ignore_failure": true
+ }
+ },
+ {
+ "remove": {
+ "field": "source.address",
+ "if": "ctx.source.address == '-'"
+ }
+ },
+ {
+ "remove": {
+ "field": "envoyproxy.response_flags",
+ "if": "ctx.envoyproxy.response_flags == '-'"
+ }
+ },
+ {
+ "split": {
+ "field": "envoyproxy.response_flags",
+ "separator": "," ,
+ "if": "ctx.envoyproxy.response_flags != null"
+ }
+ },
+ {
+ "set" : {
+ "field" : "destination.ip",
+ "value" : "{{destination.address}}",
+ "if": "ctx.destination?.address != null"
+ }
+ },
+ {
+ "set" : {
+ "field" : "source.ip",
+ "value" : "{{source.address}}",
+ "if": "ctx.source?.address != null"
+ }
+ },
+ {
+ "geoip": {
+ "field": "destination.ip",
+ "target_field": "destination.geo",
+ "if": "ctx.destination?.ip != null"
+ }
+ }
+ ],
+ "on_failure" : [{
+ "set" : {
+ "field" : "error.message",
+ "value" : "pipeline-plaintext: {{ _ingest.on_failure_message }}"
+ }
+ }]
+}
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-tcp.json b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-tcp.json
new file mode 100644
index 000000000..8a84954dc
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/elasticsearch/ingest_pipeline/pipeline-tcp.json
@@ -0,0 +1,46 @@
+{
+ "description": "Pipeline for normalizing envoy TCP ACCESS logs",
+ "processors": [
+ {
+ "remove": {
+ "field": ["upstream_service_time", "method", "user_agent", "path", "response_code"]
+ }
+ },
+ {
+ "rename": {
+ "field": "bytes_received",
+ "target_field": "destination.bytes"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "destination.bytes",
+ "type": "long"
+ }
+ },
+ {
+ "rename": {
+ "field": "bytes_sent",
+ "target_field": "source.bytes"
+ }
+ },
+ {
+ "convert" : {
+ "field" : "source.bytes",
+ "type": "long"
+ }
+ },
+ {
+ "set": {
+ "field": "envoyproxy.proxy_type",
+ "value": "tcp"
+ }
+ }
+ ],
+ "on_failure" : [{
+ "set" : {
+ "field" : "error.message",
+ "value" : "pipeline-tcp: {{ _ingest.on_failure_message }}"
+ }
+ }]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/fields/base-fields.yml b/testdata/package/integration_input/1.0.0/data_stream/foo/fields/base-fields.yml
new file mode 100644
index 000000000..c40df14f9
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/fields/base-fields.yml
@@ -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.
diff --git a/testdata/package/integration_input/1.0.0/data_stream/foo/manifest.yml b/testdata/package/integration_input/1.0.0/data_stream/foo/manifest.yml
new file mode 100644
index 000000000..89203c344
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/data_stream/foo/manifest.yml
@@ -0,0 +1,17 @@
+# This dataset has a different id then the path
+name: bar.noo
+
+title: Foo
+
+# Needs to describe the type of this input
+type: logs
+ingest_pipeline: pipeline-entry
+
+streams:
+ - input: foo
+ vars:
+ - name: paths
+ required: true
+ description: Path to log files to be collected
+ type: text
+ multi: true
diff --git a/testdata/package/integration_input/1.0.0/docs/README.md b/testdata/package/integration_input/1.0.0/docs/README.md
new file mode 100644
index 000000000..f0cf4c6c8
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/docs/README.md
@@ -0,0 +1,3 @@
+# Example readme
+
+This is a readme.
diff --git a/testdata/package/integration_input/1.0.0/img/icon.png b/testdata/package/integration_input/1.0.0/img/icon.png
new file mode 100644
index 000000000..cdfc45b4a
Binary files /dev/null and b/testdata/package/integration_input/1.0.0/img/icon.png differ
diff --git a/testdata/package/integration_input/1.0.0/img/kibana-envoyproxy.jpg b/testdata/package/integration_input/1.0.0/img/kibana-envoyproxy.jpg
new file mode 100644
index 000000000..ebdee56b9
Binary files /dev/null and b/testdata/package/integration_input/1.0.0/img/kibana-envoyproxy.jpg differ
diff --git a/testdata/package/integration_input/1.0.0/kibana/dashboard/0c610510-5cbd-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/dashboard/0c610510-5cbd-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..649963915
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/dashboard/0c610510-5cbd-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,49 @@
+{
+ "attributes": {
+ "description": "Filebeat Envoyproxy Overview Dashboard",
+ "hits": 0,
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[],\"query\":{\"language\":\"kuery\",\"query\":\"\"}}"
+ },
+ "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}",
+ "panelsJSON": "[{\"embeddableConfig\":{},\"gridData\":{\"h\":7,\"i\":\"1\",\"w\":22,\"x\":22,\"y\":0},\"panelIndex\":\"1\",\"panelRefName\":\"panel_0\",\"version\":\"8.0.0-SNAPSHOT\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":10,\"i\":\"2\",\"w\":22,\"x\":22,\"y\":7},\"panelIndex\":\"2\",\"panelRefName\":\"panel_1\",\"version\":\"8.0.0-SNAPSHOT\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":10,\"i\":\"3\",\"w\":22,\"x\":0,\"y\":7},\"panelIndex\":\"3\",\"panelRefName\":\"panel_2\",\"version\":\"8.0.0-SNAPSHOT\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":7,\"i\":\"4\",\"w\":22,\"x\":0,\"y\":0},\"panelIndex\":\"4\",\"panelRefName\":\"panel_3\",\"version\":\"8.0.0-SNAPSHOT\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":10,\"i\":\"5\",\"w\":22,\"x\":0,\"y\":17},\"panelIndex\":\"5\",\"panelRefName\":\"panel_4\",\"version\":\"8.0.0-SNAPSHOT\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":10,\"i\":\"6\",\"w\":22,\"x\":22,\"y\":17},\"panelIndex\":\"6\",\"panelRefName\":\"panel_5\",\"version\":\"8.0.0-SNAPSHOT\"}]",
+ "timeRestore": false,
+ "title": "Filebeat-Envoyproxy-Overview",
+ "version": 1
+ },
+ "migrationVersion": {
+ "dashboard": "7.0.0"
+ },
+ "references": [
+ {
+ "id": "36f872a0-5c03-11e9-85b4-19d0072eb4f2",
+ "name": "panel_0",
+ "type": "visualization"
+ },
+ {
+ "id": "80844540-5c97-11e9-8477-077ec9664dbd",
+ "name": "panel_1",
+ "type": "visualization"
+ },
+ {
+ "id": "38f96190-5c99-11e9-8477-077ec9664dbd",
+ "name": "panel_2",
+ "type": "visualization"
+ },
+ {
+ "id": "7e4084e0-5c99-11e9-8477-077ec9664dbd",
+ "name": "panel_3",
+ "type": "visualization"
+ },
+ {
+ "id": "0a994af0-5c9d-11e9-8477-077ec9664dbd",
+ "name": "panel_4",
+ "type": "visualization"
+ },
+ {
+ "id": "ab48c3f0-5ca6-11e9-8477-077ec9664dbd",
+ "name": "panel_5",
+ "type": "visualization"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/0a994af0-5c9d-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/visualization/0a994af0-5c9d-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..65a33907f
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/0a994af0-5c9d-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"lucene\",\"query\":\"\"}}"
+ },
+ "title": "Top User Agents [Filebeat Envoyproxy]",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"user_agent.name.keyword\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addLegend\":true,\"addTooltip\":true,\"dimensions\":{\"metric\":{\"accessor\":0,\"aggType\":\"count\",\"format\":{\"id\":\"number\"},\"params\":{}}},\"isDonut\":true,\"labels\":{\"last_level\":true,\"show\":false,\"truncate\":100,\"values\":true},\"legendPosition\":\"right\",\"type\":\"pie\"},\"title\":\"Top User Agents [Filebeat Envoyproxy]\",\"type\":\"pie\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/36f872a0-5c03-11e9-85b4-19d0072eb4f2.json b/testdata/package/integration_input/1.0.0/kibana/visualization/36f872a0-5c03-11e9-85b4-19d0072eb4f2.json
new file mode 100644
index 000000000..198819e7c
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/36f872a0-5c03-11e9-85b4-19d0072eb4f2.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"kuery\",\"query\":\"\"}}"
+ },
+ "title": "Top HTTP Response Codes [Filebeat Envoyproxy]",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"http.response.status_code\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"bucket\":{\"accessor\":0,\"aggType\":\"terms\",\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"number\",\"missingBucketLabel\":\"Missing\",\"otherBucketLabel\":\"Other\"}},\"params\":{}},\"maxFontSize\":72,\"metric\":{\"accessor\":1,\"aggType\":\"count\",\"format\":{\"id\":\"number\"},\"params\":{}},\"minFontSize\":18,\"orientation\":\"single\",\"scale\":\"linear\",\"showLabel\":false},\"title\":\"Top HTTP Response Codes [Filebeat Envoyproxy]\",\"type\":\"tagcloud\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/38f96190-5c99-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/visualization/38f96190-5c99-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..84ae9d5c0
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/38f96190-5c99-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"kuery\",\"query\":\"\"}}"
+ },
+ "title": "Requests per Source [Filebeat Envoyproxy]",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"source.address.keyword\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"labels\":{\"show\":true,\"truncate\":100},\"position\":\"bottom\",\"scale\":{\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{},\"type\":\"category\"}],\"dimensions\":{\"x\":null,\"y\":[{\"accessor\":0,\"aggType\":\"count\",\"format\":{\"id\":\"number\"},\"params\":{}}]},\"grid\":{\"categoryLines\":false},\"legendPosition\":\"right\",\"seriesParams\":[{\"data\":{\"id\":\"1\",\"label\":\"Count\"},\"drawLinesBetweenPoints\":true,\"mode\":\"stacked\",\"show\":\"true\",\"showCircles\":true,\"type\":\"histogram\",\"valueAxis\":\"ValueAxis-1\"}],\"times\":[],\"type\":\"histogram\",\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"LeftAxis-1\",\"position\":\"left\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Count\"},\"type\":\"value\"}]},\"title\":\"Requests per Source [Filebeat Envoyproxy]\",\"type\":\"histogram\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/7e4084e0-5c99-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/visualization/7e4084e0-5c99-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..2bfffed4c
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/7e4084e0-5c99-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"kuery\",\"query\":\"\"}}"
+ },
+ "title": "Unique Domains [Filebeat Envoyproxy]",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{\"field\":\"url.domain.keyword\"},\"schema\":\"metric\",\"type\":\"cardinality\"}],\"params\":{\"addLegend\":false,\"addTooltip\":true,\"metric\":{\"bucket\":{\"accessor\":0,\"aggType\":\"terms\",\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"missingBucketLabel\":\"Missing\",\"otherBucketLabel\":\"Other\"}},\"params\":{}},\"colorSchema\":\"Green to Red\",\"colorsRange\":[{\"from\":0,\"to\":10000}],\"invertColors\":false,\"labels\":{\"show\":false},\"metricColorMode\":\"None\",\"metrics\":[{\"accessor\":0,\"aggType\":\"cardinality\",\"format\":{\"id\":\"number\"},\"params\":{}}],\"percentageMode\":false,\"style\":{\"bgColor\":false,\"bgFill\":\"#000\",\"fontSize\":60,\"labelColor\":false,\"subText\":\"\"},\"useRanges\":false},\"type\":\"metric\"},\"title\":\"Unique Domains [Filebeat Envoyproxy]\",\"type\":\"metric\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/80844540-5c97-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/visualization/80844540-5c97-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..f4b188338
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/80844540-5c97-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"kuery\",\"query\":\"\"}}"
+ },
+ "title": "Top Domains [Filebeat Envoyproxy]",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"url.domain.keyword\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addLegend\":true,\"addTooltip\":true,\"dimensions\":{\"metric\":{\"accessor\":0,\"aggType\":\"count\",\"format\":{\"id\":\"number\"},\"params\":{}}},\"isDonut\":true,\"labels\":{\"last_level\":true,\"show\":false,\"truncate\":100,\"values\":true},\"legendPosition\":\"right\",\"type\":\"pie\"},\"title\":\"Top Domains [Filebeat Envoyproxy]\",\"type\":\"pie\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/kibana/visualization/ab48c3f0-5ca6-11e9-8477-077ec9664dbd.json b/testdata/package/integration_input/1.0.0/kibana/visualization/ab48c3f0-5ca6-11e9-8477-077ec9664dbd.json
new file mode 100644
index 000000000..91291e4ae
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/kibana/visualization/ab48c3f0-5ca6-11e9-8477-077ec9664dbd.json
@@ -0,0 +1,27 @@
+{
+ "attributes": {
+ "description": "",
+ "kibanaSavedObjectMeta": {
+ "searchSourceJSON": "{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\",\"key\":\"event.dataset\",\"negate\":false,\"params\":{\"query\":\"envoyproxy.log\"},\"type\":\"phrase\",\"value\":\"envoyproxy.log\"},\"query\":{\"match\":{\"event.dataset\":{\"query\":\"envoyproxy.log\",\"type\":\"phrase\"}}}}],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\",\"query\":{\"language\":\"kuery\",\"query\":\"event.dataset:envoyproxy.log\"}}"
+ },
+ "title": "Proxy Request Distribution [Filebeat Envoyproxy] ",
+ "uiStateJSON": "{}",
+ "version": 1,
+ "visState": "{\"aggs\":[{\"enabled\":true,\"id\":\"1\",\"params\":{},\"schema\":\"metric\",\"type\":\"count\"},{\"enabled\":true,\"id\":\"2\",\"params\":{\"field\":\"envoyproxy.proxy_type.keyword\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"size\":5},\"schema\":\"segment\",\"type\":\"terms\"}],\"params\":{\"addLegend\":true,\"addTooltip\":true,\"dimensions\":{\"metric\":{\"accessor\":0,\"aggType\":\"count\",\"format\":{\"id\":\"number\"},\"params\":{}}},\"isDonut\":true,\"labels\":{\"last_level\":true,\"show\":false,\"truncate\":100,\"values\":true},\"legendPosition\":\"right\",\"type\":\"pie\"},\"title\":\"Proxy Request Distribution [Filebeat Envoyproxy] \",\"type\":\"pie\"}"
+ },
+ "migrationVersion": {
+ "visualization": "7.1.0"
+ },
+ "references": [
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
+ "type": "index-pattern"
+ },
+ {
+ "id": "logs-*",
+ "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
+ "type": "index-pattern"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.0/manifest.yml b/testdata/package/integration_input/1.0.0/manifest.yml
new file mode 100644
index 000000000..63da411dc
--- /dev/null
+++ b/testdata/package/integration_input/1.0.0/manifest.yml
@@ -0,0 +1,30 @@
+format_version: 1.0.0
+
+name: integration_input
+description: This is the example integration
+version: 1.0.0
+title: Integration input
+categories: ["crm", "azure"]
+type: integration
+release: ga
+
+owner.github: "ruflin"
+
+conditions:
+ kibana:
+ version: "^8.4.0"
+
+screenshots:
+ - src: /img/kibana-envoyproxy.jpg
+ title: IP Tables Ubiquity Dashboard
+ size: 1492x1464
+ type: image/png
+
+policy_templates:
+ - name: logs
+ title: Logs datasource
+ description: Datasource for your log files.
+ categories:
+ - datastore
+ inputs:
+ - type: foo
diff --git a/testdata/package/integration_input/1.0.2/agent/input/input.yml.hbs b/testdata/package/integration_input/1.0.2/agent/input/input.yml.hbs
new file mode 100644
index 000000000..6eb03670b
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/agent/input/input.yml.hbs
@@ -0,0 +1,9 @@
+metricsets: ["query"]
+period: {{period}}
+hosts:
+{{#each hosts}}
+ - {{this}}
+{{/each}}
+driver: {{driver}}
+sql_query: {{sql_query}
+sql_response_format: {{sql_response_format}}
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.2/changelog.yml b/testdata/package/integration_input/1.0.2/changelog.yml
new file mode 100644
index 000000000..41eaeb973
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/changelog.yml
@@ -0,0 +1,6 @@
+# newer versions go on top
+- version: "1.0.1"
+ changes:
+ - description: Initial draft of the package
+ type: enhancement
+ link: https://github.com/elastic/package-spec/pull/325
diff --git a/testdata/package/integration_input/1.0.2/docs/README.md b/testdata/package/integration_input/1.0.2/docs/README.md
new file mode 100644
index 000000000..2023396ba
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/docs/README.md
@@ -0,0 +1 @@
+# SQL Input
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.2/fields/input.yml b/testdata/package/integration_input/1.0.2/fields/input.yml
new file mode 100644
index 000000000..f5851c64b
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/fields/input.yml
@@ -0,0 +1,4 @@
+- name: input.name
+ type: constant_keyword
+ description: Sample field to be added.
+ value: logs
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.2/img/sample-logo.svg b/testdata/package/integration_input/1.0.2/img/sample-logo.svg
new file mode 100644
index 000000000..6268dd88f
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/img/sample-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/testdata/package/integration_input/1.0.2/img/sample-screenshot.png b/testdata/package/integration_input/1.0.2/img/sample-screenshot.png
new file mode 100644
index 000000000..d7a56a3ec
Binary files /dev/null and b/testdata/package/integration_input/1.0.2/img/sample-screenshot.png differ
diff --git a/testdata/package/integration_input/1.0.2/manifest.yml b/testdata/package/integration_input/1.0.2/manifest.yml
new file mode 100644
index 000000000..bdedea348
--- /dev/null
+++ b/testdata/package/integration_input/1.0.2/manifest.yml
@@ -0,0 +1,70 @@
+format_version: 1.0.0
+name: integration_input
+title: Integration Input
+description: >-
+ Sample package that was an integration and got migrated to input
+type: input
+version: 1.0.2
+license: basic
+categories:
+ - custom
+ - datastore
+conditions:
+ kibana:
+ version: "^8.4.0"
+policy_templates:
+ - name: sql_query
+ type: metrics
+ title: SQL Query
+ description: Query the database to capture metrics.
+ input: sql
+ template_path: input.yml.hbs
+ vars:
+ - name: hosts
+ type: text
+ title: Hosts
+ multi: true
+ required: true
+ show_user: true
+ default:
+ - http://127.0.0.1
+ - name: period
+ type: text
+ title: Period
+ multi: false
+ required: true
+ show_user: true
+ default: 10s
+ - name: driver
+ type: text
+ title: Driver
+ description: "Supported database drivers: mssql, mysql, oracle, postgres"
+ multi: false
+ required: true
+ show_user: true
+ default: "mysql"
+ - name: sql_query
+ type: text
+ title: Query
+ multi: false
+ required: true
+ show_user: true
+ default: "SHOW GLOBAL STATUS LIKE 'Innodb_system%'"
+ - name: sql_response_format
+ type: text
+ title: Response format
+ description: "Supported response formats: variables, table"
+ multi: false
+ required: true
+ show_user: false
+ default: "variables"
+icons:
+ - src: "/img/sample-logo.svg"
+ type: "image/svg+xml"
+screenshots:
+ - src: "/img/sample-screenshot.png"
+ title: "Sample screenshot"
+ size: "600x600"
+ type: "image/png"
+owner:
+ github: elastic/integrations
diff --git a/testdata/package/sql_input/0.2.0/agent/input/input.yml.hbs b/testdata/package/sql_input/0.2.0/agent/input/input.yml.hbs
new file mode 100644
index 000000000..6eb03670b
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/agent/input/input.yml.hbs
@@ -0,0 +1,9 @@
+metricsets: ["query"]
+period: {{period}}
+hosts:
+{{#each hosts}}
+ - {{this}}
+{{/each}}
+driver: {{driver}}
+sql_query: {{sql_query}
+sql_response_format: {{sql_response_format}}
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.2.0/changelog.yml b/testdata/package/sql_input/0.2.0/changelog.yml
new file mode 100644
index 000000000..37b3d9d3f
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/changelog.yml
@@ -0,0 +1,6 @@
+# newer versions go on top
+- version: "0.2.0"
+ changes:
+ - description: Initial draft of the package
+ type: enhancement
+ link: https://github.com/elastic/package-spec/pull/325
diff --git a/testdata/package/sql_input/0.2.0/docs/README.md b/testdata/package/sql_input/0.2.0/docs/README.md
new file mode 100644
index 000000000..2023396ba
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/docs/README.md
@@ -0,0 +1 @@
+# SQL Input
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.2.0/fields/input.yml b/testdata/package/sql_input/0.2.0/fields/input.yml
new file mode 100644
index 000000000..f5851c64b
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/fields/input.yml
@@ -0,0 +1,4 @@
+- name: input.name
+ type: constant_keyword
+ description: Sample field to be added.
+ value: logs
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.2.0/img/sample-logo.svg b/testdata/package/sql_input/0.2.0/img/sample-logo.svg
new file mode 100644
index 000000000..6268dd88f
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/img/sample-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.2.0/img/sample-screenshot.png b/testdata/package/sql_input/0.2.0/img/sample-screenshot.png
new file mode 100644
index 000000000..d7a56a3ec
Binary files /dev/null and b/testdata/package/sql_input/0.2.0/img/sample-screenshot.png differ
diff --git a/testdata/package/sql_input/0.2.0/manifest.yml b/testdata/package/sql_input/0.2.0/manifest.yml
new file mode 100644
index 000000000..0d548eb43
--- /dev/null
+++ b/testdata/package/sql_input/0.2.0/manifest.yml
@@ -0,0 +1,67 @@
+format_version: 1.0.0
+name: sql_input
+title: SQL Input
+description: >-
+ Execute custom queries against an SQL database and store the results in Elasticsearch.
+type: input
+version: 0.2.0
+license: basic
+categories:
+ - custom
+ - datastore
+policy_templates:
+ - name: sql_query
+ type: metrics
+ title: SQL Query
+ description: Query the database to capture metrics.
+ input: sql
+ template_path: input.yml.hbs
+ vars:
+ - name: hosts
+ type: text
+ title: Hosts
+ multi: true
+ required: true
+ show_user: true
+ default:
+ - http://127.0.0.1
+ - name: period
+ type: text
+ title: Period
+ multi: false
+ required: true
+ show_user: true
+ default: 10s
+ - name: driver
+ type: text
+ title: Driver
+ description: "Supported database drivers: mssql, mysql, oracle, postgres"
+ multi: false
+ required: true
+ show_user: true
+ default: "mysql"
+ - name: sql_query
+ type: text
+ title: Query
+ multi: false
+ required: true
+ show_user: true
+ default: "SHOW GLOBAL STATUS LIKE 'Innodb_system%'"
+ - name: sql_response_format
+ type: text
+ title: Response format
+ description: "Supported response formats: variables, table"
+ multi: false
+ required: true
+ show_user: false
+ default: "variables"
+icons:
+ - src: "/img/sample-logo.svg"
+ type: "image/svg+xml"
+screenshots:
+ - src: "/img/sample-screenshot.png"
+ title: "Sample screenshot"
+ size: "600x600"
+ type: "image/png"
+owner:
+ github: elastic/integrations
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.3.0/agent/input/input.yml.hbs b/testdata/package/sql_input/0.3.0/agent/input/input.yml.hbs
new file mode 100644
index 000000000..6eb03670b
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/agent/input/input.yml.hbs
@@ -0,0 +1,9 @@
+metricsets: ["query"]
+period: {{period}}
+hosts:
+{{#each hosts}}
+ - {{this}}
+{{/each}}
+driver: {{driver}}
+sql_query: {{sql_query}
+sql_response_format: {{sql_response_format}}
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.3.0/changelog.yml b/testdata/package/sql_input/0.3.0/changelog.yml
new file mode 100644
index 000000000..1b79760d8
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/changelog.yml
@@ -0,0 +1,6 @@
+# newer versions go on top
+- version: "0.3.0"
+ changes:
+ - description: Initial draft of the package
+ type: enhancement
+ link: https://github.com/elastic/package-spec/pull/325
diff --git a/testdata/package/sql_input/0.3.0/docs/README.md b/testdata/package/sql_input/0.3.0/docs/README.md
new file mode 100644
index 000000000..2023396ba
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/docs/README.md
@@ -0,0 +1 @@
+# SQL Input
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.3.0/fields/input.yml b/testdata/package/sql_input/0.3.0/fields/input.yml
new file mode 100644
index 000000000..f5851c64b
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/fields/input.yml
@@ -0,0 +1,4 @@
+- name: input.name
+ type: constant_keyword
+ description: Sample field to be added.
+ value: logs
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.3.0/img/sample-logo.svg b/testdata/package/sql_input/0.3.0/img/sample-logo.svg
new file mode 100644
index 000000000..6268dd88f
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/img/sample-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/testdata/package/sql_input/0.3.0/img/sample-screenshot.png b/testdata/package/sql_input/0.3.0/img/sample-screenshot.png
new file mode 100644
index 000000000..d7a56a3ec
Binary files /dev/null and b/testdata/package/sql_input/0.3.0/img/sample-screenshot.png differ
diff --git a/testdata/package/sql_input/0.3.0/manifest.yml b/testdata/package/sql_input/0.3.0/manifest.yml
new file mode 100644
index 000000000..d86e3b947
--- /dev/null
+++ b/testdata/package/sql_input/0.3.0/manifest.yml
@@ -0,0 +1,67 @@
+format_version: 1.0.0
+name: sql_input
+title: SQL Input
+description: >-
+ Execute custom queries against an SQL database and store the results in Elasticsearch.
+type: input
+version: 0.3.0
+license: basic
+categories:
+ - custom
+ - datastore
+policy_templates:
+ - name: sql_query
+ type: metrics
+ title: SQL Query
+ description: Query the database to capture metrics.
+ input: sql
+ template_path: input.yml.hbs
+ vars:
+ - name: hosts
+ type: text
+ title: Hosts
+ multi: true
+ required: true
+ show_user: true
+ default:
+ - http://127.0.0.1
+ - name: period
+ type: text
+ title: Period
+ multi: false
+ required: true
+ show_user: true
+ default: 10s
+ - name: driver
+ type: text
+ title: Driver
+ description: "Supported database drivers: mssql, mysql, oracle, postgres"
+ multi: false
+ required: true
+ show_user: true
+ default: "mysql"
+ - name: sql_query
+ type: text
+ title: Query
+ multi: false
+ required: true
+ show_user: true
+ default: "SHOW GLOBAL STATUS LIKE 'Innodb_system%'"
+ - name: sql_response_format
+ type: text
+ title: Response format
+ description: "Supported response formats: variables, table"
+ multi: false
+ required: true
+ show_user: false
+ default: "variables"
+icons:
+ - src: "/img/sample-logo.svg"
+ type: "image/svg+xml"
+screenshots:
+ - src: "/img/sample-screenshot.png"
+ title: "Sample screenshot"
+ size: "600x600"
+ type: "image/png"
+owner:
+ github: elastic/integrations