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
Filebeat should not setup ML modules if the index pattern does not exist #11349
Comments
I agree with removing However, the third reason you mentioned is not true. It is possible to pick a specific module using the |
Thanks for the clarification. I can confirm that if |
I suggest to add a deprecation warning in 7.x and delete the flag in 8.0. So in the future ML would be set up when the user runs |
The main problem is the index pattern + the ml code in kibana defaulting to INDEX_PATTERN_NAME, if the index pattern does not yet exists. Filebeat installs the index pattern only if dashboards are installed. Filebeat calls a kibana API to install the machine learning jobs. It does not hold the jobs. When running I wonder if the index pattern name is indeed required to create the data feeds or not.
@jgowdyelastic ^ Can you comment on this please? If the index pattern is a must, then Beats should ensure that the index pattern exists before attempting to install machine learning jobs. |
The setup endpoint could be changed to allow it to work if an index pattern hasn't been created. This would allow the datafeed to be created correctly in this situation. I think the suggestion This change will not fix the issue with beats, because all of the Beats ML modules contain custom URLs and saved objects and so a valid index pattern is required. |
+1 btw. I can easily workaround the error in ES security by adding read rights to an imaginary (non-existent) index named INDEX_PATTERN_NAME. This should not be possible.
Which is ok. At least we would have a proper error message explaining the actual problem. On the Beats side we can still consider to separate the index pattern installation from the dashboards and require users to run it before. In the end |
I missed how this conversation evolved... |
@ruflin Maybe you know best about the timeline. Like deprecating features in Beats and when integrations will have the required features. |
@sophiec20 @urso I think it is too early to give a final answer. I hope the answer will be yes. If we remove it, we will need to add a deprecation warnings in the 7.x releases. |
The user experience from the command line is suboptimal as the setup step, in general, is happening before data is being ingested, and this is not the right time to create the ML jobs. There is already a preferred way to create the ML modules from inside the ML UI App and there is a path to an improved future with Integrations. Considering the reward vs effort of improving the user experience of the setup ML command line in 7.x, then I would advocate we deprecate/remove this feature soon. From my point of view, because we already have the ability to create the ML modules in the Stack (i.e. in the ML app), then we are not actually removing functionality and this is not dependent on Integrations. |
@sophiec20 +1 on your suggestion. |
Sounds good. @kvch Please add a deprecation warning to 7.6. @sophiec20 Is there some good documentation link we can include in the deprecation warning? |
I opened a PR to add a deprecation warning: #14532 |
The flag `--machine-learning` is going to be removed in 8.0, as ML jobs have to be configured using the ML app in Kibana. The following warning is emitted when running `./filebeat setup --machine-learning`: ``` $ ./filebeat setup --machine-learning Setting up ML using setup --machine-learning is going to be removed in 8.0. Please use the ML app instead. See more: https://www.elastic.co/guide/en/elastic-stack-overview/current/xpack-ml.html Loaded machine learning job configurations ``` When the flag `-e` is passed a warning shows up in the logs: ``` 2019-11-15T10:54:12.420+0100 WARN [cfgwarn] instance/beat.go:558 DEPRECATED: Setting up ML using Filebeat is going to be removed. Please use the ML app to setup jobs. Will be removed in version: 8.0 ``` Has to be backported to 7.x. Closes #11349
The flag `--machine-learning` is going to be removed in 8.0, as ML jobs have to be configured using the ML app in Kibana. The following warning is emitted when running `./filebeat setup --machine-learning`: ``` $ ./filebeat setup --machine-learning Setting up ML using setup --machine-learning is going to be removed in 8.0. Please use the ML app instead. See more: https://www.elastic.co/guide/en/elastic-stack-overview/current/xpack-ml.html Loaded machine learning job configurations ``` When the flag `-e` is passed a warning shows up in the logs: ``` 2019-11-15T10:54:12.420+0100 WARN [cfgwarn] instance/beat.go:558 DEPRECATED: Setting up ML using Filebeat is going to be removed. Please use the ML app to setup jobs. Will be removed in version: 8.0 ``` Has to be backported to 7.x. Closes elastic#11349 (cherry picked from commit 61718de)
The flag `--machine-learning` is going to be removed in 8.0, as ML jobs have to be configured using the ML app in Kibana. The following warning is emitted when running `./filebeat setup --machine-learning`: ``` $ ./filebeat setup --machine-learning Setting up ML using setup --machine-learning is going to be removed in 8.0. Please use the ML app instead. See more: https://www.elastic.co/guide/en/elastic-stack-overview/current/xpack-ml.html Loaded machine learning job configurations ``` When the flag `-e` is passed a warning shows up in the logs: ``` 2019-11-15T10:54:12.420+0100 WARN [cfgwarn] instance/beat.go:558 DEPRECATED: Setting up ML using Filebeat is going to be removed. Please use the ML app to setup jobs. Will be removed in version: 8.0 ``` Has to be backported to 7.x. Closes #11349 (cherry picked from commit 61718de)
x86_64 x86_64 x86_64 GNU/Linux
./filebeat setup --machine-learning
On a clean installation, if you run
./filebeat setup --machine-learning
first, before any other filebeat setup step, then the ML jobs created are invalid. They have their datafeed config set forindices: INDEX_PATTERN
. This string is meant to be substituted for the kibana index patternfilebeat-*
which is not possible as it does not yet exist.If the index pattern exists prior to running ml setup, then the ML jobs are created properly.
The following setup methods work, as the index pattern is created before ML setup.
I suspect this problem is not limited to RC1 and has existed in 6.x time frame.
On a more conceptual note, perhaps we could consider removing the
./filebeat setup --machine-learning
command line option for the following reasons:./filebeat setup --machine-learning
would be in order to add ML jobs to an existing deployment that is already collecting data using filebeat. However this can be done already from the wizard inside the ML Kibana app../filebeat setup --machine-learning
does not allow you to pick specific modules. As it stands today, filebeat setup will create both nginx and apache ML jobs and it is unlikely both are required.The text was updated successfully, but these errors were encountered: