Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12108

API event.get limit is incorrect

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.2.6rc1, 3.4.0alpha1
    • 3.2.4
    • API (A)
    • Sprint 7
    • 0.25

      Please see attached screenshot.
      As data, Total 10 events here. (145~136)

      EventID details... 
      
      145 ~ 142 : Problem
      141       : Recovery
      140 ~ 136 : Problem (RESOLVED)
      

      LIMIT setting when using event.get API, returns less results than expected.

      This examples event.get API request parameters to set limit 8

      {
          "jsonrpc": "2.0",
          "method": "event.get",
          "params": {
              "objectids": "13563",
              "output": "extend",
              "select_acknowledges": "extend",
              "selectTags": "extend",
              "sortfield": ["clock", "eventid"],
              "sortorder": "DESC",
              "limit":8
          },
          "auth": "821280da015be09404b1cfba3616528a",
          "id": 1
      }
      

      The result is 5. (145~141)

      {
        "jsonrpc": "2.0",
        "result": [
          {
            "eventid": "145",
            "source": "0",
            "object": "0",
            "objectid": "13563",
            "clock": "1493185990",
            "value": "1",
            "acknowledged": "0",
            "ns": "918463065",
            "r_eventid": "0",
            "c_eventid": "0",
            "correlationid": "0",
            "userid": "0",
            "acknowledges": [],
            "tags": []
          },
          {
            "eventid": "144",
            "source": "0",
            "object": "0",
            "objectid": "13563",
            "clock": "1493185970",
            "value": "1",
            "acknowledged": "0",
            "ns": "626525868",
            "r_eventid": "0",
            "c_eventid": "0",
            "correlationid": "0",
            "userid": "0",
            "acknowledges": [],
            "tags": []
          },
          {
            "eventid": "143",
            "source": "0",
            "object": "0",
            "objectid": "13563",
            "clock": "1493185969",
            "value": "1",
            "acknowledged": "0",
            "ns": "769788374",
            "r_eventid": "0",
            "c_eventid": "0",
            "correlationid": "0",
            "userid": "0",
            "acknowledges": [],
            "tags": []
          },
          {
            "eventid": "142",
            "source": "0",
            "object": "0",
            "objectid": "13563",
            "clock": "1493185967",
            "value": "1",
            "acknowledged": "0",
            "ns": "641690886",
            "r_eventid": "0",
            "c_eventid": "0",
            "correlationid": "0",
            "userid": "0",
            "acknowledges": [],
            "tags": []
          },
          {
            "eventid": "141",
            "source": "0",
            "object": "0",
            "objectid": "13563",
            "clock": "1493185965",
            "value": "0",
            "acknowledged": "0",
            "ns": "385297444",
            "r_eventid": "0",
            "c_eventid": "0",
            "correlationid": "0",
            "userid": "0",
            "acknowledges": [],
            "tags": []
          }
        ],
        "id": 1
      }
      

      5 Events has returned instead of 8. (It is not an exact LIMIT 8)

      If limit is not set, 10 Events data will be returned.

            Unassigned Unassigned
            JKKim Kim Jongkwon
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: