Query regarding IP Lookup feature

I know Discourse logs the Last IP and the Registration IP of users, and I was wondering which one of these the Lookup feature searches for.

Since there is an option to look up the both the Last and Registration IPs individually, I presume Last searches for other matching Last IPs and Registration searches for other matching Registration IPs?

If someone could just clarify this that would be great, thanks.

1 Like

It works with both registered and last logged in IP. If the same user shows up more than once, the forum ignores it and lists each account only once.

If a user made their account on IP then logs in on another, you can find them using both IPs.

Yep, so does that mean the Last search only searches Last IPs that match, and Registered search only searches Registered IPS that match?

(Here’s an image to aid with what I mean)

Essentially I’m asking the question of what’s the difference between the two searches

1 Like

Picture a giant table with rows and columns, all of the data is filled in from user accounts. Each column has different fields, like usernames, email, how old the user is, and more, and there is a user in every row.

That search field is using a SELECT ... WHERE ... SQL query searching the columns of usernames, emails, registered IP OR last logged in IP. If a user has a matching IP in their row, it will be displayed in search results.

According to the profiler, this is the SQL query it performs to locate the users (IP censored):

Where are you looking up the IPs at? I’m assuming you’re using the search bar at the top of the user list in Admin.