Extract gateway last seen from application server

Hi there!
I’d like to extract the last seen information from chirpstack. I can see this information in the application server, which says for example " a few seconds ago", but I need to extract this data. I’ve been looking for this info in the different API’s but I can’t find it.
Thanks in advance!

You can get it from postgresql using next commands in the application server DB

select name,last_seen_at from device; – for devices
select name,last_seen_at from gateway; – for gateways

you can use more or other column names from that tables at your own discretion for select

or you can do it via ChirpStack REST API /api/gateways/ you will get full information about GW’s
“lastSeenAt” fulltimestamp also.

1 Like

Hi eugenev!
Thanks a lot! Your second solution works perfectly for me!
Best regards!