https://github.com/mrtc0/wazuh
Wazuh REST API in Go
https://github.com/mrtc0/wazuh
Last synced: about 1 year ago
JSON representation
Wazuh REST API in Go
- Host: GitHub
- URL: https://github.com/mrtc0/wazuh
- Owner: mrtc0
- License: apache-2.0
- Created: 2019-01-05T20:46:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T14:38:02.000Z (over 2 years ago)
- Last Synced: 2025-04-15T23:05:00.821Z (about 1 year ago)
- Language: Go
- Homepage: https://godoc.org/github.com/mrtc0/wazuh
- Size: 50.8 KB
- Stars: 16
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wazuh API in Go
[](https://travis-ci.org/mrtc0/wazuh)
---
Wazuh REST API library
https://documentation.wazuh.com/current/user-manual/api/reference.html
## Install
```powershell
$ go get -u github.com/mrtc0/wazuh
```
## Usage
```golang
package main
import (
"flag"
"fmt"
"os"
"github.com/mrtc0/wazuh"
)
func main() {
flag.Parse()
args := flag.Args()
endpoint := args[0]
user := args[1]
pass := args[2]
client, err := wazuh.New(endpoint, wazuh.WithBasicAuth(user, pass))
agents, err := client.GetAllAgents()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("%-20v%-20v\n", "ID", "NAME")
for _, agent := range *agents {
if agent.Status == "Active" {
fmt.Printf("%-20v%-20v\n", agent.ID, agent.Name)
}
}
}
```
[see example](./example)
## Contributing
You are more than welcome to contribute to this project.
Fork and make a Pull Request, or create an Issue if you see any problem.