-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] "Package policy is invalid: inputs.logfile.streams.log.log.vars.paths: Invalid format" when preconfiguring custom logs integration #113400
Comments
Interestingly, I'm able to successfully create a custom logs policy via the Fleet UI, but it generates a package policy where {
"name" : "log-1",
"description" : "",
"namespace" : "default",
"policy_id" : "custom-logs-123",
"enabled" : true,
"output_id" : "",
"inputs" : [
{
"type" : "logfile",
"policy_template" : "logs",
"enabled" : true,
"streams" : [
{
"enabled" : true,
"data_stream" : {
"type" : "logs",
"dataset" : "log.log"
},
"vars" : {
"paths" : {
"type" : "text",
"value" : [
"/var/log/wifi.log"
]
},
"data_stream.dataset" : {
"value" : "generic",
"type" : "text"
},
"custom" : {
"value" : "",
"type" : "yaml"
}
},
"id" : "logfile-log.log-1933315a-69ce-46d2-b756-178ec33d706f",
"compiled_stream" : {
"paths" : [
"/var/log/wifi.log"
],
"data_stream" : {
"dataset" : "generic"
}
}
}
]
}
],
"package" : {
"name" : "log",
"title" : "Custom logs",
"version" : "0.5.0"
},
"revision" : 1,
"created_at" : "2021-09-29T13:26:48.142Z",
"created_by" : "elastic",
"updated_at" : "2021-09-29T13:26:48.142Z",
"updated_by" : "elastic"
},
"type" : "ingest-package-policies",
"references" : [ ],
"migrationVersion" : {
"ingest-package-policies" : "7.15.0"
},
"coreMigrationVersion" : "8.0.0",
"updated_at" : "2021-09-29T13:26:48.147Z"
} This makes sense, considering Updating the YML in the preconfiguration file to specify xpack.fleet.packages:
- name: log
version: latest
xpack.fleet.agentPolicies:
- name: Custom Logs Policy
id: custom-logs-123
namespace: default
package_policies:
- package:
name: log
name: log-1-preconfigured
inputs:
- type: logfile
enabled: true
streams:
- data_stream:
dataset: log.log
enabled: true
vars:
- name: paths
value:
- /var/log/wifi.log @david-kow - Are you able to share the config you're using and still seeing issues with in Kibana? I'd like to try and translate one-to-one into my |
It looks like this error is expected behavior on Fleet's side. Previously, we weren't validating package policy inputs during the preconfiguration/setup process, but as of this PR , we validate package policies any time we perform our input overriding logic whether it's on the client as part of the policy editor UI or on the server as part of preconfiguration/setup. b1253db#diff-3c2c778705d1b16042158c84def8fa9129aaf694f05217944a8231434d5104c1R959-R971 So @david-kow and @barkbay - you should be able to provide an array value for Closing this issue out. |
Specifying package_policies:
- package:
name: log
name: log-1
inputs:
- type: logfileou
enabled: true
streams:
- data_stream:
dataset: log.log
enabled: true
vars:
- name: paths
value:
- '/var/log/containers/*${kubernetes.container.id}.log'
- name: custom
value: |
symlinks: true
condition: ${kubernetes.namespace} == 'default' fails in
@kpollich Are you aware of a change in the custom log integration in |
I am not aware of any such changes, no. The In the YML you pasted above, you've got I ran through Kibana setup successfully with the following in my xpack.fleet.packages:
- name: log
version: latest
xpack.fleet.agentPolicies:
- name: Custom Logs Policy
id: custom-logs-123
namespace: default
package_policies:
- package:
name: log
name: log-1
inputs:
- type: logfile
enabled: true
streams:
- data_stream:
dataset: log.log
enabled: true
vars:
- name: paths
value:
- '/var/log/containers/*${kubernetes.container.id}.log'
- name: custom
value: |
symlinks: true
condition: ${kubernetes.namespace} == 'default' |
Oh sorry for the typo but it is only in GitHub, I test well with I tested with the 'Custom Logs Policy' you shared below (gist), Kibana and Fleet start but Elastic Agents fail with:
Also I see the agent policy (https://localhost:5601/app/fleet/policies/custom-logs-123) but it does not have any integrations and I don't see any custom logs integration in https://localhost:5601/app/integrations/detail/log-0.4.6/policies compared to you. There must be something else wrong on my side. I noticed that if I removed: If I add it to your example, I get the package policy error
|
I haven't made much progress. Just saw it works fine in @kpollich Did you test in |
Think I tested in |
Hi, this issue is still persisting on 8.4.1 - has a fix or solution been proposed? I am looking to leverage this to fully automate and config my stack. Thanks |
Hi @MachLearnPort - I am going to reopen this and we'll take a look soon on 8.4.1. |
I tried to reproduce this bug locally on current main (8.7.0-snapshot) with this preconfiguration on my
For me fleet is starting normally and the agent is working as expected, I see no failures or other strange behaviors. @kpollich I believe that there have been several changes done to the preconfiguration logic, am I correct? |
@criamico - Yes you are correct. This was likely fixed elsewhere in updates to preconfiguration logic/policy validation. I'm closing this for now. Please re-open if this occurs on a particular stack version of custom logs integration version. Many thanks! |
Hi, Cattura The version that i use of components are kibana,elastic,fleet,elastic-agent : 8.13.2 The configuration works until log 1.1.2 from 2.0.0 doesn't works This is my yaml file
Thank you very much |
Kibana version: 7.15
Ref elastic/cloud-on-k8s#4873 (comment)
Summary
When attempting to preconfigure the custom logs integration, Kibana throws an error during Fleet setup:
Package policy is invalid: inputs.logfile.streams.log.log.vars.paths: Invalid format
:Steps to Reproduce
Add preconfigured values for
xpack.fleet.packages
andxpack.fleet.agentPolicies
as below:Then, attempt to load the Fleet or Integrations apps. Observe the "Error during Fleet setup" as above.
The text was updated successfully, but these errors were encountered: