[ZBX-15195] Calculated item fails when item key contains doublequote " Created: 2018 Nov 21  Updated: 2018 Dec 06  Resolved: 2018 Dec 06

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

Type: Incident report Priority: Minor
Reporter: Shane Arnold Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: calculateditems, escaping
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-3444 Simplify item key referencing in aggr... Closed

 Description   

Steps to reproduce:

  1. Create item such as vfs.file.time["E:\test.file",modify]
  2. Attempt to use this item in a Zabbix Calculated item
  3. Item will fail with Incorrect function 'now' expression. Check expression part starting from: "vfs.file.time["

Result:
error reason for "MCCMULSVR2:vfs.file.age["E:\FD.BAK",modify]" changed: Incorrect function 'now' expression. Check expression part starting from: "vfs.file.time["

Expected:
Double quotes in an item key should be ignored, so not to interfere with the syntax of a calculated item. If double-quotes must be used (for example, a file path containing spaces), then the Zabbix Calculated item should not be trying to parse the item containing the quotes as if it were the "closing" quotes for the calculated function.

Working Calculated Item: now("vfs.file.time[E:\FD.BAK,modify]")-last("vfs.file.time[E:\FD.BAK,modify]")

Broken Calculated Item: now("vfs.file.time["E:\FD.BAK,modify"]")-last("vfs.file.time["E:\FD.BAK,modify"]")



 Comments   
Comment by richlv [ 2018 Nov 21 ]

Please see "key" description and example 5 in https://www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/calculated .

This would have been a good topic on Zabbix IRC channel or other support options, see https://zabbix.org/wiki/Getting_help for more detail.

Comment by Glebs Ivanovskis [ 2018 Nov 21 ]

You may be interested in ZBXNEXT-3444.

Comment by Shane Arnold [ 2018 Nov 22 ]

Thank-you for the responses. I didn't even think to escape the problem characters. ZBXNEXT-3444 definitely looks like a suggestion that would address this. Looks like the documentation does indeed mention the requirement to escape keys, so this is my fault Happy to close.

Generated at Fri Apr 26 08:05:26 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.