quesiton about retrieving logs
-
Hi,
I'm trying to use the client but have some question, need some help.
My goal is to grab all the last events, login..., from a specific user based on his email by example.So if we take this for example:
response, errors, err := client.SearchEventLogs()
the module explaintion gove me that:
func (*fusionauth.FusionAuthClient).SearchEventLogs(request fusionauth.EventLogSearchRequest) (*fusionauth.EventLogSearchResponse, *fusionauth.Errors, error) SearchEventLogs Searches the event logs with the specified criteria and pagination. EventLogSearchRequest request The search criteria and pagination information. (fusionauth.FusionAuthClient).SearchEventLogs on pkg.go.dev
but what is the function input ?? What does refer the struct linked to request fusionauth.EventLogSearchRequest ?
Ty,
AdrienThis was pulled over from https://github.com/FusionAuth/go-client/issues/66
-
In general, you'll use the JSON defined in the API documentation to build the request. Unfortunately, the Search Event Logs API doc doesn't have sample JSON (I filed an issue) but it does have the fields: https://fusionauth.io/docs/v1/tech/apis/event-logs#search-event-logs
You can also find the
EventLogSearchRequest
in the client code:https://github.com/FusionAuth/go-client/blob/master/pkg/fusionauth/Domain.go#L1545
This points at https://github.com/FusionAuth/go-client/blob/master/pkg/fusionauth/Domain.go#L1534
However, I'm not sure searching event logs gets you what you are trying to accomplish:
My goal is to grab all the last events, login..., from a specific user based on his email by example.
You probably want to search login records: https://fusionauth.io/docs/v1/tech/apis/login#search-login-records
https://github.com/FusionAuth/go-client/blob/master/pkg/fusionauth/Domain.go#L3145
https://github.com/FusionAuth/go-client/blob/master/pkg/fusionauth/Domain.go#L3134