Understanding log entry Id format and Log entry order

When we fetch log entry from Incident via REST API, we are getting log entry id in alpha-numeric format.

For e.g. when we hit https://api.pagerduty.com/log_entries
in that we are getting log entry id like below
{
“log_entries”: [
{
“id”: “R929XBP27NLXE3H9Y0H1DN49G4”

}]}

so here we can see that id is alpha-numeric.

We basically need to do numeric operations on revision Id but as this is alpha-numeric we can’t do so is there any way where any other field is exposed from API which is in numeric format and having revision ID.

Additionally we want to know that is order of log entry is guaranteed always ?
Like if Entity E1 is updated twice at same time T1 so basically there are 2 updates on that incident within same. Now int this case, when we get audits via https://api.pagerduty.com/log_entries will this always be on same order which means if I execute any number of time it will return same result always ?

Hi @hardik!

Please correct me if I’m wrong, but I think you’re asking how to ensure your log entries are returned in order. You can do this by sending the sort_by query-string parameter. So, if I wanted to sort log entries in ascending order by created_at my API call would look something like this:

https://api.pagerduty.com/incidents/<incidentID>/log_entries/?sort_by=created_at:asc

Here our question is different and also I am talking about global audit list and not audit specific to incident.

If Same time multiple audits are generated then does the same order will be guaranteed to return always.

So if same time 2 audits are generated and we hit audit URL https://api.pagerduty.com/log_entries
then it will return audit A1 and audit A2.
Now does this guaranteed that If I hit that URL again then I will get same sequence of order which is A1 and A2.

Another question is , is this possible to get audit log id in numeric format ?

Hi @hardik, regarding your first question, log entry ids returned from our API are not numerical. They will always be obfuscated, hence alphanumeric. All PagerDuty IDs are this way; most are 7 alphanumeric characters starting with P, but log entries are in a different alphanumeric format, as you noted. I’m not sure if I follow the end goal of doing “numeric operations on revision Id”, but you can only get alphanumeric IDs from our API.

Regarding your question about log entry order, they should always be returned in the same order. We order results by incident ID and creation date, so regardless of when or how many times you query the endpoint, it should be the same every time.

I hope that helps!