-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Design]Automate the migration of log
input states to filestream
#31749
Comments
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
A couple of questions:
Why is the
|
It's part of the workflow I came up with. Obviously, I am open to different workflows, I tried to come up with something that involves the least amount of user interaction. Also, it is not required if you want to migrate all inputs to Migration workflow:
In my workflow there is no intermediary step when there are both |
log
input states to filestream
log
input states to filestream
Just want to give a +1 to this feature. For our environment, clobbering the filebeat registry on an upgrade is not an option, and will prevent us from upgrading if a path forward isn't provided. We can't double-ship data. |
super important feature. +1 |
Goal
Migrating from
log
input tofilestream
is painful if you want to avoid data duplication. The goal of this issue is to automatically migrate the existing state information oflog
input tofilestream
input.filestream
input does not have access tolog
input states, and also stores information in a different data structure.State info of
log
inputIn the logfile
State: https://github.com/elastic/beats/blob/main/filebeat/input/file/state.go#L28-L42
State info of
filestream
inputState: https://github.com/elastic/beats/blob/main/filebeat/input/filestream/input.go#L47-L49
Meta: https://github.com/elastic/beats/blob/main/filebeat/input/filestream/input.go#L51-L54
Differences
filestream
instead oflogs
type
,id
,prev_id
andFileStateOS
is not part of thefilestream
stateidentifier_name
is part ofmeta
source
is part ofmeta
offset
is part ofcursor
Note about
container
inputIn case of
conatiner
input,meta
also stores thestream
the logs are coming from (stdout, stderr). Infilestream
it is concatenated to the end of the ID. Example:filestream::my-filestream-id::native::8787338-65029::stderr
.User interface
If we distribute is as part of Filebeat, I suggest we add a new subcommand.
The name of the new subcommand could be
migrate
andlog-to-filestream
. It would accept one parameter, an ID or a comma separated list of IDs of filestream inputs. If no id is set, allfilestream
inputs are migrated.Development
The registry consists of two files: key-value store and a log file. The selected states have to be updated in both places.
To avoid breaking existing state information of the user, we should backup the registry before doing any transformations. If something goes wrong, we can rollback to the previous version.
Testing
We have to test if the following cases in both the key-value store and in the log file:
log
input state with unfinished filelog
input state with finished filelog
input state with a TTL of -1log
input state with a TTL of -2log
input state withpath
identifierlog
input state withinode_marker
identifierlog
input state where the input has an IDThe test case is successful if a valid
log
input state can be transformed to a validfilestream
state and can be continued from the correct offset. This will need both unit tests and integration tests.The text was updated successfully, but these errors were encountered: