Zabbix Documentation 4.2

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:config:items:item

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
manual:config:items:item [2019/07/16 14:03]
martins-v more precise wording
manual:config:items:item [2019/07/17 08:03] (current)
martins-v removing duplicated jsonpath examples
Line 91: Line 91:
 ^Structured data  ^^^ ^Structured data  ^^^
 |   ​|//​XML XPath// ​ |Extract value or fragment from XML data using XPath functionality.\\ For this option to work, Zabbix server must be compiled with libxml support.\\ Examples:\\ ''​number(/​document/​item/​value)''​ will extract ''​10''​ from ''<​document><​item><​value>​10</​value></​item></​document>''​\\ ''​number(/​document/​item/​@attribute)''​ will extract ''​10''​ from ''<​nowiki><​document><​item attribute="​10"></​item></​document></​nowiki>''​\\ ''/​document/​item''​ will extract ''<​item><​value>​10</​value></​item>''​ from ''<​document><​item><​value>​10</​value></​item></​document>''​\\ Note that namespaces are not supported.\\ Supported since 3.4.0.\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ | |   ​|//​XML XPath// ​ |Extract value or fragment from XML data using XPath functionality.\\ For this option to work, Zabbix server must be compiled with libxml support.\\ Examples:\\ ''​number(/​document/​item/​value)''​ will extract ''​10''​ from ''<​document><​item><​value>​10</​value></​item></​document>''​\\ ''​number(/​document/​item/​@attribute)''​ will extract ''​10''​ from ''<​nowiki><​document><​item attribute="​10"></​item></​document></​nowiki>''​\\ ''/​document/​item''​ will extract ''<​item><​value>​10</​value></​item>''​ from ''<​document><​item><​value>​10</​value></​item></​document>''​\\ Note that namespaces are not supported.\\ Supported since 3.4.0.\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |
-|:::|//JSON Path// ​ |Extract value or fragment from JSON data using [[:​manual/​appendix/​items/​jsonpath|JSONPath functionality]].\\ (//Note// that only a simple subset of JSONPath functionality is supported in Zabbix 4.2.0-4.2.4.)\\ JSONPath can be specified using the dot notation:\\ ''​$.document.item.value''​\\ or the bracket notation:\\ ''​$['​document'​]['​item'​]['​value'​]''​\\ The former, dot notation, can be used only if object names consist of alphanumeric + underscore characters:​\\ ''​$.document.item_0.value''​\\ If object name contains other characters, e. g. blanks, dashes, you must use the bracket notation:\\ ''​$['​document'​]['​item 0'​]['​value-0'​]''​\\ Both notations can be mixed:\\ ''​$.document['​item'​].value''​\\ For both notations only direct paths to single objects are supported.\\ Using unquoted number in brackets refers to an array index:\\ ''​$.document[2].value''​\\ If object name is a number it must be referred either by dot notation or in quotes using bracket notation.\\ Extracting multiple values is not supported.\\ More examples:\\ ''​$.document.item.value''​ will extract ''​10''​ from ''<​nowiki>​{"​document":​{"​item":​{"​value":​ 10}}}</​nowiki>''​\\ ''​$.document.item''​ will extract ''<​nowiki>​{"​value":​ 10}</​nowiki>''​ from ''<​nowiki>​{"​document":​{"​item":​{"​value":​ 10}}}</​nowiki>''​\\ ''​$['​a document'​].item.value''​ will extract ''​10''​ from ''<​nowiki>​{"​a document":​{"​item":​{"​value":​ 10}}}</​nowiki>''​\\ ''​$.document.items[1].value''​ will extract ''​20''​ from ''<​nowiki>​{"​document":​{"​items":​[{"​value":​ 10}, {"​value":​ 20}]}}</​nowiki>''​\\ ''​$["​8"​].items[2].value''​ or ''​$.8.items[2].value''​ will extract ''​30''​ from ''<​nowiki>​{"​8":​{"​items":​[{"​value":​ 10},​{"​value":​ 20},​{"​value":​ 30}]}}</​nowiki>''​\\ Supported since 3.4.0.\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |+|:::|//JSON Path// ​ |Extract value or fragment from JSON data using [[:​manual/​appendix/​items/​jsonpath|JSONPath functionality]].\\ (//Note// that only a simple subset of JSONPath functionality is supported in Zabbix 4.2.0-4.2.4.)\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |
 ^Arithmetic ​ ^^^ ^Arithmetic ​ ^^^
 |   ​|//​Custom multiplier// ​ |Multiply the value by the specified integer or floating-point value.\\ Use this option to convert values received in KB, MBps, etc into B, Bps. Otherwise Zabbix cannot correctly set [[:​manual/​appendix/​suffixes|prefixes]] (K, M, G etc).\\ //Note// that if the item type of information is //Numeric (unsigned)//,​ incoming values with a fractional part will be trimmed (i.e. '​0.9'​ will become '​0'​) before the custom multiplier is applied.\\ Starting with Zabbix 2.2, using scientific notation is also supported. E.g. 1e+70.\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ | |   ​|//​Custom multiplier// ​ |Multiply the value by the specified integer or floating-point value.\\ Use this option to convert values received in KB, MBps, etc into B, Bps. Otherwise Zabbix cannot correctly set [[:​manual/​appendix/​suffixes|prefixes]] (K, M, G etc).\\ //Note// that if the item type of information is //Numeric (unsigned)//,​ incoming values with a fractional part will be trimmed (i.e. '​0.9'​ will become '​0'​) before the custom multiplier is applied.\\ Starting with Zabbix 2.2, using scientific notation is also supported. E.g. 1e+70.\\ If you mark the //Custom on fail// checkbox, the item will not become unsupported in case of failed preprocessing step and it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |