-
Notifications
You must be signed in to change notification settings - Fork 5k
[Filebeat] Filestream running as Log input under Elastic Agent or feature flag #46587
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
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
Have you tested this with the inputs when running as beats receivers? It is critically important that this change has no impact on that conversion right now.
Think of any cases where these changes could interact and make sure there is no impact. |
It should have no effect because the changes are at the input instantiation. Anyways, I'll create tests for those scenarios as well. |
| - name: log.file.device_id | ||
| type: keyword | ||
| required: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this targeting 9.3.0? Will it be in GA? Feel free to adjust as needed.
| required: false | |
| required: false | |
| version: | |
| ga: 9.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those fields have existed since a long time, some of the tests introduced by this PR check the fields generated by the input against fields.yml, so it made sense to me to add them.
I could also modify the test to ignore those fields. Let me think a bit more about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those fields have existed since a long time
If they've existed since before 9.0.0, I'm ok with just leaving out versioning information.
| - name: log.file.inode | ||
| type: long | ||
| required: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this targeting 9.3.0? Will it be in GA? Feel free to adjust as needed.
| required: false | |
| required: false | |
| version: | |
| ga: 9.3.0 |
Proposed commit message
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added an entry inCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.## Disruptive User ImpactAuthor's Checklist
How to test this PR locally
Manual test
{ "log.level": "debug", "@timestamp": "2025-09-12T12:28:06.899-0400", "log.logger": "input.harvester", "log.origin": { "function": "github.com/elastic/beats/v7/filebeat/input/log.(*Log).Read", "file.name": "log/log.go", "file.line": 111 }, "message": "End of file reached: /tmp/flog.log; Backoff now.", "service.name": "filebeat", "input_id": "94a20b13-6927-4ff4-8f99-4f750469ed96", "source_file": "/tmp/flog.log", "state_id": "native::26052-40", "finished": false, "os_id": "26052-40", "harvester_id": "69128be5-d1f4-4493-935a-889d0461c95d", "ecs.version": "1.6.0" }features:section in the configuration{ "log.level": "debug", "@timestamp": "2025-09-12T12:31:07.586-0400", "log.logger": "input.filestream", "log.origin": { "function": "github.com/elastic/beats/v7/filebeat/input/filestream.(*logFile).Read", "file.name": "filestream/filestream.go", "file.line": 139 }, "message": "End of file reached: /tmp/flog.log; Backoff now.", "service.name": "filebeat", "id": "log-as-filestream", "source_file": "filestream::log-as-filestream::fingerprint::445d01af94a604742ab7bb9db8b5bceff4b780925c2f8c7729165076319fc016", "path": "/tmp/flog.log", "state-id": "fingerprint::445d01af94a604742ab7bb9db8b5bceff4b780925c2f8c7729165076319fc016", "ecs.version": "1.6.0" }Elastic Agent
Create a log file with some lines
docker run -it --rm mingrammer/flog -n 20 > /tmp/flog.logRun a standalone Elastic Agent with the following configuration (adjust the output settings as necessary)
elastic-agent.yml
Ensure all events have been ingested
Look at the logs, you will see Log input logs as described in the manual test
Stop the Elastic Agent
Uncomment
run_as_filestream: truefrom the configurationStart the Elastic Agent again
Ensure no more data is added to the output, no data duplication.
Look at the logs, you will see Filestream input logs as described in the manual test
You can also collect the diagnostics and look at the registry
components/log-defaulttar -xf registry.tar.gzcat registry/filebeat/log.json|jq -Sc{"id":3,"op":"set"} {"k":"filebeat::logs::native::16-50","v":{"FileStateOS":{"device":50,"inode":16},"id":"native::16-50","identifier_name":"native","offset":2113,"prev_id":"","source":"/tmp/flog.log","timestamp":[280186759520503,1762292780],"ttl": -1,"type":"log"}} {"id":4,"op":"set"} {"k":"filestream::your-log-stream-id::native::16-50","v":{"cursor":{"offset":2113},"meta":{"identifier_name":"native","source":"/tmp/flog.log"},"ttl":-1,"updated":[281470681743360,18446744011573954816]}} {"id":5,"op":"remove"} {"k":"filebeat::logs::native::16-50"} {"id":6,"op":"set"} {"k":"filestream::your-log-stream-id::native::16-50","v":{"cursor":{"offset":2113},"meta":{"identifier_name":"native","source":"/tmp/flog.log"},"ttl":-1,"updated":[281470681743360,18446744011573954816]}}Run the tests
Related issues
## Use cases## Screenshots## Logs