Hi,
I have unsuccessfully been trying to integrate Osquery to elastic-agent on windows but every time I enroll an agent, its status changes to unhealthy a few seconds after enrolling.
The log file is full of entries like this.
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:24.748Z",
"log.origin": {
"file.name": "stateresolver/stateresolver.go",
"file.line": 48
},
"message": "New State ID is USB5jmUA",
"ecs.version": "1.6.0"
}
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:24.748Z",
"log.origin": {
"file.name": "stateresolver/stateresolver.go",
"file.line": 49
},
"message": "Converging state requires execution of 4 step(s)",
"ecs.version": "1.6.0"
}
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:24.864Z",
"log.origin": {
"file.name": "operation/operator.go",
"file.line": 284
},
"message": "operation 'operation-install' skipped for metricbeat.7.16.3",
"ecs.version": "1.6.0"
}
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:24.864Z",
"log.origin": {
"file.name": "operation/operator.go",
"file.line": 284
},
"message": "operation 'operation-start' skipped for metricbeat.7.16.3",
"ecs.version": "1.6.0"
}
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:25.007Z",
"log.origin": {
"file.name": "operation/operator.go",
"file.line": 284
},
"message": "operation 'operation-install' skipped for osquerybeat.7.16.3",
"ecs.version": "1.6.0"
}
{
"log.level": "info",
"@timestamp": "2022-01-27T00:26:25.075Z",
"log.origin": {
"file.name": "log/reporter.go",
"file.line": 40
},
"message": "2022-01-27T00:26:25Z - message: Application: osquerybeat--7.16.3[7711f2db-b675-400f-adae-a952f4690892]: State changed to RESTARTING: Restarting - type: 'STATE' - sub_type: 'STARTING'",
"ecs.version": "1.6.0"
}
{
"log.level": "error",
"@timestamp": "2022-01-27T00:26:25.076Z",
"log.origin": {
"file.name": "fleet/fleet_gateway.go",
"file.line": 180
},
"message": "failed to dispatch actions, error: operator: failed to execute step sc-run, error: failed to start 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-d420cc\\install\\osquerybeat-7.16.3-windows-x86_64\\osquerybeat': exec: \"C:\\\\Program Files\\\\Elastic\\\\Agent\\\\data\\\\elastic-agent-d420cc\\\\install\\\\osquerybeat-7.16.3-windows-x86_64\\\\osquerybeat\": file does not exist: failed to start 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-d420cc\\install\\osquerybeat-7.16.3-windows-x86_64\\osquerybeat': exec: \"C:\\\\Program Files\\\\Elastic\\\\Agent\\\\data\\\\elastic-agent-d420cc\\\\install\\\\osquerybeat-7.16.3-windows-x86_64\\\\osquerybeat\": file does not exist",
"ecs.version": "1.6.0"
}
{
"log.level": "error",
"@timestamp": "2022-01-27T00:26:25.076Z",
"log.origin": {
"file.name": "log/reporter.go",
"file.line": 36
},
"message": "2022-01-27T00:26:25Z - message: Application: osquerybeat--7.16.3[7711f2db-b675-400f-adae-a952f4690892]: State changed to FAILED: failed to start 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-d420cc\\install\\osquerybeat-7.16.3-windows-x86_64\\osquerybeat': exec: \"C:\\\\Program Files\\\\Elastic\\\\Agent\\\\data\\\\elastic-agent-d420cc\\\\install\\\\osquerybeat-7.16.3-windows-x86_64\\\\osquerybeat\": file does not exist - type: 'ERROR' - sub_type: 'FAILED'",
"ecs.version": "1.6.0"
}
The logs seem to indicate that a file related to osquerybeat is missing but when checking the download and install directories it seem to be there. Not sure where to check next to get more information. I have uninstalled the agent and reinstalled many times but same error every times.