Python API Server Log ignoring time filter?

09-21-2022 11:56 AM
Occasional Contributor III

Not really sure how best to title this, sorry.

Using the Python API guide as a follow-along for 'managing your gis servers'

The query itself is working but seems to be ignoring the time filter:


 comparing to the GUI in Sever Manager I'm not lining up these times with anything. I can supply any argument I want for start_time and no error is returned:


If I leave out the 'start_time' parameter entirely, the query returns exactly what I'm seeing in the Server Manager GUI exactly.

I'm I using start_time wrong? (Or is my understanding of it incorrect?)

0 Kudos
1 Reply
Occasional Contributor III

So I decided to test this for Portal logs too and it works just as expected there.

If I only filter for a start_time of 1 day ago i'm getting back hundreds of entries going back a month or so.


now =
StartTime = now - datetime.timedelta(hours=1)

ServerLogs = server1.logs.query(level = 'SEVERE',start_time = StartTime)

If i use the GUI in Server Manager with the same filter, I see 4 entries.

Any querying from the API and the Portal log GUI however match exactly.

The reference documentation for arguments is slightly different from Portal to Server however...





0 Kudos