Select to view content in your preferred language

Python API Server Log ignoring time filter?

551
2
09-21-2022 11:56 AM
ZacharyHart
Honored Contributor

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:

1663612354750.png

 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:

1663612559970b.png

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
2 Replies
ZacharyHart
Honored Contributor

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 = datetime.datetime.now()
StartTime = now - datetime.timedelta(hours=1)
StartTime

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

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...

ZacharyHart_0-1664819129626.png

ZacharyHart_1-1664819190568.png

 

 

0 Kudos
AnjulPandey
Regular Contributor

@ZacharyHart  Did your datetime filtering issue have been resolved or are you still looking for a solution?

Has anybody experienced the same problem?

It appears that the issue still persists in the latest released version despite a bug for the same issue.

Bug ID: BUG-000149808

 

0 Kudos