You are not logged in.
Pages: 1
Hello,
I am trying to search for Log (or Events) with the search engine (using .../apirest.php/search/Log for example), and the API do returns some results into the data key, but those results are all empty.
For example :
GET <glpi_server>/apirest.php/search/Log :
{
"totalcount": 122,
"count": 20,
"sort": [
"1"
],
"order": [
"ASC"
],
"data": [
[],
[],
...
[],
[]
],
"content-range": "0-19/122"
}
Same kind of results are returned when searching on itemType "Glpi%5CEvent".
Also, when trying the route: apirest.php/listSearchOptions/Log
I only get:
{
"common": {
"name": "Characteristics"
}
}
So, does anyone know if I can search for Logs or Events, with queries and filters ?
Thank you
Offline
Historical data is not searchable by the current API as that type lacks search options.
There was a pull request to make historical data searchable in GLPI previously, but wasn't added due to concerns about performance:
https://github.com/glpi-project/glpi/pull/7658
I don't think that will be added in GLPI. However, you can still get some historical data at the item level by adding a "with_logs=1" query parameter.
Example:
/apirest.php/Computer/1?with_logs=1
That shows the data directly from the database for that item, so it may not be perfectly readable in some cases.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you very much for your answer.
That's a pitty, as I think this PR was exactly what I needed.
In case that rings a bell for anyone, here is what I need to do :
Searching for any ticket that were previously in a certain group, but not anymore, since a precise timestamp.
If anyone has an idea of how to do that, I'm interested
Thanks
Offline
GLPI 10.1 will have a new API (alongside the old rather than replacing it) which isn't reliant on the existing GLPI search/search options. It may be possible to allow more access to historical data through the new API, though I haven't started development on historical data at all in the new API yet.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Pages: 1