Skip to main content

Best practice for GetFeed for LogRecord on multiple devices?

TuckerBA-1087
Original Poster

I want to do a GetFeed on devices by group. Is the best way to do it to run a Get request on Device and search by group, then do a multi call of GetFeed requests on LogRecords searching by the resulting devices from the first request?

 

I also though about just doing a LogRecord feed and filtering after the fact by the list of devices, but felt that would be a lot worse.

 

I guess I'm really just checking to make sure there isn't a way to do a GetFeed on LogRecord searching by multiple devices in a single request.

 

Thanks,

Tucker

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

Top Answers

Hey Tucker!

 

This will depend on the use case, but why not cheat? Well, exploit an existing function, but 'cheat' sounds more compelling in this case.

 

GetFeed respects user settings for both security and groups, and well, user accounts are free.

 

I would just create a user for the group in question and use that to get the data.

 

It's not elegant, but it's real easy to do, and you're already managing user accounts / passwords, what's one more?

 

Again, this really depends on the use case, but depending on the group size, it can make it a lot simpler.

 

 

 

Aaron

 

5 Replies

Hey Tucker,

 

I'm not sure I'm envisioning this correctly, but the second option feels more "right" to me. If you are pulling feed data into your own database, then if you've already got processed Gets of devices and their groups organized in that database, then the LogRecords don't need to be sorted or filtered, just processed as records - the device id should correspond to something already organized of you just update <whatever> by device id.

 

You *could* do it the first way, I've just never looked at the organization and call process for such a thing or what the reason to do it might be. The method I describe above was exactly that used to simply update a "live map" location for devices that had already been hierarchically organized in that system.

 

Thanks,

Ken

TuckerBA-1087
Original Poster

Thanks Ken,

 

This is great information. I wasn't thinking about it, but you're definitely right for most cases that the 2nd option would be better. I didn't want to do it because for this specific instance it's a large db with hundreds of groups and we only need to run it for 3 groups, so it would be a lot of excess data, but I forgot to mention that in my original post. This is definitely good to know for future reference with best practices for GetFeed though. Thanks!

Hey Tucker!

 

This will depend on the use case, but why not cheat? Well, exploit an existing function, but 'cheat' sounds more compelling in this case.

 

GetFeed respects user settings for both security and groups, and well, user accounts are free.

 

I would just create a user for the group in question and use that to get the data.

 

It's not elegant, but it's real easy to do, and you're already managing user accounts / passwords, what's one more?

 

Again, this really depends on the use case, but depending on the group size, it can make it a lot simpler.

 

 

 

Aaron

 

TuckerBA-1087
Original Poster

This is the perfect idea for my use case. The customer wants to do a GetFeed for 3 groups basically but it's 3 groups out of hundreds of groups so I didn't want to do a full GetFeed on every LogRecord in the db so I was leaning towards keeping up with all of the feeds separately but didn't love that idea either. This solves both of those issues. Thanks for the suggestion!

Glad I could help!

 

Bill Gates — 'I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.'

Still have questions?