FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    quesiton about retrieving logs

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    1
    2
    509
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      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,
      Adrien

      This was pulled over from https://github.com/FusionAuth/go-client/issues/66

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @dan
        last edited by

        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

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post