github.com/leitu/go-osquery

use go to executive osqueryi to get the data, the default osqueryd with port is not that easy to use


License
MIT
Install
go get github.com/leitu/go-osquery

Documentation

goquery

use go to executive osqueryi to get the data

Requirement

Run

go run main.go
go install
goquery

Page

http://localhost:8080/tables

Curl

curl -i -H "Content-Type: application/json" -X POST \
      -d '{ "user":"leitu", "sql": "SELECT version  FROM kernel_info"}'\
      http://localhost:8080/query

Results

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Tue, 01 Mar 2016 08:12:31 GMT
Content-Length: 27

[
  {"version":"15.3.0"}
]

You also can use command way to get the data directly

 go run query-kernel.go
{"version":"15.3.0"}

ToDo

  • SQL section to default value.
  • move query-kernel.go to cli way