[ZBX-7751] Calculated item; item key containing ')' breaks parsing. (occurs with e.g. perf_counter) Created: 2014 Feb 04  Updated: 2017 May 30  Resolved: 2014 Feb 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.1
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Tom Duijf (xs-) Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-2066 Trouble with with calculated items ha... Closed

 Description   

Formula parsing breaks if an item key contains ")", perhaps other chars as well.

  • zbx-web will accept the formula on form submission.
  • Next calculation run an error will occur, item status will become 'not supported'

In this example, the closing ")" of the perfmon_counter (instance) is interpreted as the closing ")" of last().
Formula:
last( host:perf_counter["\some.perfmon.context(instance)\metric"] ) + last( host:some.other.key )
Error:
Cannot evaluate function [last()]: item [host:perf_counter["\some.perfmon.context(instance] not found

I did try to add escaping & additional quoting, doesn't seem to help.



 Comments   
Comment by Tom Duijf (xs-) [ 2014 Feb 04 ]

Forgot username to jira and created new account + this ticket. Found old account details again.
Can you switch reporter of this ticket to this account and delete the 'newly created' one?

Sorry :~|

Comment by Aleksandrs Saveljevs [ 2014 Feb 05 ]

Try putting the item in quotes, like this:

last("host:perf_counter[\"\some.perfmon.context(instance)\metric\"]")

See also https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/calculated#usage_examples .

Generated at Wed Nov 05 20:45:50 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.