[ZBX-22849] Not possible to get open events using the event.get API Created: 2023 May 24  Updated: 2025 Jul 01

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 6.4.2, 7.0.16
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Yurii Polenok Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 2
Labels: api, event.get
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Steps to reproduce:

{
    "jsonrpc": "2.0",
    "method": "event.get",
    "params": {
        "output": [
            "eventid",
            "value",
            "r_eventid"
        ],
        "value": "1",
        "search": {
            "r_eventid": "0"
        },
        "startSearch": true,
        "limit": 5
    },
    "id": 1
}

Result:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "eventid": "3761654",
            "value": "1",
            "r_eventid": "0"
        },
        {
            "eventid": "4083768",
            "value": "1",
            "r_eventid": "0"
        },
        {
            "eventid": "5171834",
            "value": "1",
            "r_eventid": "5171926"
        },
        {
            "eventid": "5171837",
            "value": "1",
            "r_eventid": "5171840"
        },
        {
            "eventid": "5171839",
            "value": "1",
            "r_eventid": "5171844"
        }
    ],
    "id": 1
}

Expected:
Only active/open/problem/not resolved events, with r_eventid = 0, meaning the event is still not resolved.

If I have missed some parameter to filter such events, please advise how to do it.



 Comments   
Comment by Aigars Kadikis [ 2023 May 25 ]

To get open(active) events, have a look at the API method problem.get:
https://www.zabbix.com/documentation/current/en/manual/api/reference/problem/get

The ZBX project is for bug reports only. Currently, your use case does not look like a bug.

To get free support please use: https://www.zabbix.com/forum/ or contact Zabbix professional services.

Comment by Yurii Polenok [ 2023 May 25 ]

Thanks aigars.kadikis!
problem.get solves our problem. It would be great if it only showed problems that are visible on the web, but now it can also return problems that are related to disabled hosts, items, triggers, and other objects. Same behaviour for event.get and problem.get.

Comment by Thiago [ 2024 May 08 ]

I Think this is a bug, search ou filter by r_eventid = 0 and result not like expected.

Comment by Aigars Kadikis [ 2025 Jul 01 ]

Reproduced with 7.0.16 frontend. Searching by 'eventid' works well:

{
  "jsonrpc": "2.0",
  "method": "event.get",
  "params": {
    "output": [
      "eventid",
      "value",
      "r_eventid"
    ],
    "filter": {
      "eventid": "3021317"
    }
  },
  "id": 1
}
 

It can report:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "eventid": "3021317",
      "value": "1",
      "r_eventid": "0"
    }
  ],
  "id": 1
}

But when trying to filter by "r_eventid" field:

{
  "jsonrpc": "2.0",
  "method": "event.get",
  "params": {
    "output": [
      "eventid",
      "value",
      "r_eventid"
    ],
    "filter": {
      "r_eventid": "0"
    }
  },
  "id": 1
}

It prints:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32602,
        "message": "Invalid params.",
        "data": "Invalid parameter \"/filter\": unexpected parameter \"r_eventid\"."
    },
    "id": 1
}

The API call with a "search" method in the ticket description reports reply:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32602,
        "message": "Invalid params.",
        "data": "Invalid parameter \"/search\": unexpected parameter \"r_eventid\"."
    },
    "id": 1
}
Generated at Sun Jul 06 01:23:00 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.