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

    quesiton about retrieving logs

    Scheduled Pinned Locked Moved Unsolved Q&A
    2 Posts 1 Posters 1.4k Views
    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 - Identity Without Constraints
      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 - Identity Without Constraints
        https://fusionauth.io

        1 Reply Last reply
        Reply Quote 0
        • danD dan moved this topic from Q&A on
        • danD dan moved this topic from Frequently Asked Questions (FAQ) on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post