diff --git a/include/defines.inc.php b/include/defines.inc.php
index 90ee055..b15bd04 100644
--- a/include/defines.inc.php
+++ b/include/defines.inc.php
@@ -539,6 +539,11 @@ define('SCREEN_REFRESH_RESPONSIVENESS',	10);
 
 define('DEFAULT_LATEST_ISSUES_CNT', 20);
 
+define('LATEST_DATA_MATCH_SUBSTRING', 0);
+define('LATEST_DATA_MATCH_NOT_SUBSTRING', 1);
+define('LATEST_DATA_MATCH_REGEX', 2);
+define('LATEST_DATA_MATCH_NOT_REGEX', 3);
+
 // alignes
 define('HALIGN_DEFAULT',	0);
 define('HALIGN_CENTER',		0);
diff --git a/latest.php b/latest.php
index 2336689..cf965b3 100644
--- a/latest.php
+++ b/latest.php
@@ -52,6 +52,8 @@ $fields=array(
 	'fullscreen'=>			array(T_ZBX_INT, O_OPT,	P_SYS,	IN('0,1'),	NULL),
 // filter
 	'select'=>				array(T_ZBX_STR, O_OPT, NULL,	NULL,		NULL),
+	'select_val'=>			array(T_ZBX_STR, O_OPT, NULL,	NULL,		NULL),
+	'select_val_opts'=>			array(T_ZBX_INT, O_OPT, NULL,	NULL,		NULL),
 	'show_without_data'=>	array(T_ZBX_INT, O_OPT, NULL,	IN('0,1'),	NULL),
 	'filter_rst'=>			array(T_ZBX_INT, O_OPT,	P_SYS,	IN('0,1'),	NULL),
 	'filter_set'=>			array(T_ZBX_STR, O_OPT,	P_SYS,	null,		NULL),
@@ -83,15 +85,21 @@ if (!isset($_REQUEST['show_without_data'])) {
 
 if(isset($_REQUEST['filter_rst'])){
 	$_REQUEST['select'] = '';
+	$_REQUEST['select_val'] = '';
+	$_REQUEST['select_val_opts'] = LATEST_DATA_MATCH_SUBSTRING;
 	$_REQUEST['show_without_data'] = 0;
 }
 
 if(isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])){
 	CProfile::update('web.latest.filter.select',$_REQUEST['select'], PROFILE_TYPE_STR);
+	CProfile::update('web.latest.filter.select_val',$_REQUEST['select_val'], PROFILE_TYPE_STR);
+	CProfile::update('web.latest.filter.select_val_opts',$_REQUEST['select_val_opts'], PROFILE_TYPE_INT);
 	CProfile::update('web.latest.filter.show_without_data',$_REQUEST['show_without_data'], PROFILE_TYPE_INT);
 }
 else {
 	$_REQUEST['select'] = CProfile::get('web.latest.filter.select', '');
+	$_REQUEST['select_val'] = CProfile::get('web.latest.filter.select_val', '');
+	$_REQUEST['select_val_opts'] = CProfile::get('web.latest.filter.select_val_opts', 'substring');
 	$_REQUEST['show_without_data'] = CProfile::get('web.latest.filter.show_without_data', 0);
 }
 // --------------
@@ -134,6 +142,7 @@ $filterForm->setAttribute('name','zbx_filter');
 $filterForm->setAttribute('id','zbx_filter');
 
 $filterForm->addRow(_('Show items with name like'), new CTextBox('select',$_REQUEST['select'],20));
+$filterForm->addRow(array(_('Show items with values matching'),SPACE, new CComboBox('select_val_opts', $_REQUEST['select_val_opts'], null, array('substring', 'not substring', 'regex', 'not regex'))), new CTextBox('select_val',$_REQUEST['select_val'],20));
 $filterForm->addRow(_('Show items without data'), new CCheckBox('show_without_data', $_REQUEST['show_without_data'], null, 1));
 
 $reset = new CButton("filter_rst", _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
@@ -280,8 +289,8 @@ while($db_item = DBfetch($db_items)){
 
 	$db_app['item_cnt']++;
 
-	if(isset($showAll) && !empty($apps) && !isset($apps[$db_app['applicationid']])) continue;
-	else if(isset($hideAll) && (empty($apps) || isset($apps[$db_app['applicationid']]))) continue;
+	if (empty($_REQUEST['select_val']) && isset($showAll) && !empty($apps) && !isset($apps[$db_app['applicationid']])) continue;
+	else if (empty($_REQUEST['select_val']) && isset($hideAll) && (empty($apps) || isset($apps[$db_app['applicationid']]))) continue;
 
 	if (isset($db_item['lastclock'])) {
 		$lastclock = zbx_date2str(_('d M Y H:i:s'), $db_item['lastclock']);
@@ -292,6 +301,32 @@ while($db_item = DBfetch($db_items)){
 
 	$lastvalue = formatItemValue($db_item);
 
+	if(!empty($_REQUEST['select_val'])) {
+		switch ($_REQUEST['select_val_opts']) {
+			case LATEST_DATA_MATCH_SUBSTRING:
+				$zbx_match = zbx_stristr($lastvalue, $_REQUEST['select_val']);
+				break;
+			case LATEST_DATA_MATCH_NOT_SUBSTRING:
+				$zbx_match = !zbx_stristr($lastvalue, $_REQUEST['select_val']);
+				break;
+			case LATEST_DATA_MATCH_REGEX:
+				$zbx_match = preg_match('|'.$_REQUEST['select_val'].'|', $lastvalue);
+				break;
+			case LATEST_DATA_MATCH_NOT_REGEX:
+				$zbx_match = !preg_match('|'.$_REQUEST['select_val'].'|', $lastvalue);
+				break;
+		}
+	}
+	else {
+		$zbx_match = true;
+	}
+
+	// Remove items from application if the value doesn't match the filter
+	if(!$zbx_match) {
+        $db_app['item_cnt']--;
+        continue;
+    }
+
 	$digits = ($db_item['value_type'] == ITEM_VALUE_TYPE_FLOAT) ? 2 : 0;
 	if (isset($db_item['lastvalue']) && isset($db_item['prevvalue'])
 			&& ($db_item['value_type'] == ITEM_VALUE_TYPE_FLOAT || $db_item['value_type'] == ITEM_VALUE_TYPE_UINT64)
@@ -323,16 +358,18 @@ while($db_item = DBfetch($db_items)){
 
 	$item_status = $db_item['status'] == ITEM_STATUS_NOTSUPPORTED ? 'unknown' : null;
 
-	array_push($app_rows, new CRow(array(
-		SPACE,
-		is_show_all_nodes()?SPACE:null,
-		($_REQUEST['hostid']>0)?NULL:SPACE,
-		new CCol(SPACE.SPACE.$description, $item_status),
-		new CCol($lastclock, $item_status),
-		new CCol($lastvalue, $item_status),
-		new CCol($change, $item_status),
-		$actions
-	)));
+	if ((isset($showAll) && (empty($apps) || isset($apps[$db_app['applicationid']]))) || (isset($hideAll) && !isset($apps[$db_app['applicationid']]) && !empty($apps))) {
+		array_push($app_rows, new CRow(array(
+			SPACE,
+			is_show_all_nodes()?SPACE:null,
+			($_REQUEST['hostid']>0)?NULL:SPACE,
+			new CCol(SPACE.SPACE.$description, $item_status),
+			new CCol($lastclock, $item_status),
+			new CCol($lastvalue, $item_status),
+			new CCol($change, $item_status),
+			$actions
+		)));
+	}
 }
 unset($app_rows);
 unset($db_app);
@@ -373,24 +410,26 @@ foreach ($db_apps as $appid => $db_app) {
 	$url.= url_param('groupid').url_param('hostid').url_param('fullscreen').url_param('select');
 	$link = new CLink($img,$url);
 
-	$col = new CCol(array(bold($db_app['name']),SPACE.'('._n('%1$s Item', '%1$s Items', $db_app['item_cnt']).')'));
+	if ($db_app['item_cnt'] != 0) {
+		$col = new CCol(array(bold($db_app['name']),SPACE.'('._n('%1$s Item', '%1$s Items', $db_app['item_cnt']).')'));
 
-	$col->setColSpan(5);
-	// host JS menu link
+		$col->setColSpan(5);
+		// host JS menu link
 
-	$hostSpan = null;
-	if ($_REQUEST['hostid'] == 0) {
-		$hostSpan = new CSpan($host['name'], 'link_menu menu-host');
-		$scripts = $hostScripts[$host['hostid']];
-		$hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
-	}
+		$hostSpan = null;
+		if ($_REQUEST['hostid'] == 0) {
+			$hostSpan = new CSpan($host['name'], 'link_menu menu-host');
+			$scripts = $hostScripts[$host['hostid']];
+			$hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
+		}
 
-	$table->addRow(array(
-		$link,
-		get_node_name_by_elid($db_app['applicationid']),
-		$hostSpan,
-		$col
-	));
+		$table->addRow(array(
+			$link,
+			get_node_name_by_elid($db_app['applicationid']),
+			$hostSpan,
+			$col
+			));
+	}
 
 	foreach($app_rows as $row)
 		$table->addRow($row);
@@ -447,14 +486,15 @@ while ($db_item = DBfetch($db_items)) {
 		$db_item['unitsLong'] = '';
 
 	$db_host = &$db_hosts[$db_item['hostid']];
+	//TODO: Value "0" doesn't work properly. Same for "0." and "0.0". It's replaced with "0" in the form.
 
 	if (!isset($tab_rows[$db_host['hostid']])) $tab_rows[$db_host['hostid']] = array();
 	$app_rows = &$tab_rows[$db_host['hostid']];
 
 	$db_host['item_cnt']++;
 
-	if (isset($showAll) && !empty($apps) && !isset($apps[0])) continue;
-	else if (isset($hideAll) && (empty($apps) || isset($apps[0]))) continue;
+	if (empty($_REQUEST['select_val']) && isset($showAll) && !empty($apps) && !isset($apps[0])) continue;
+	else if (empty($_REQUEST['select_val']) && isset($hideAll) && (empty($apps) || isset($apps[0]))) continue;
 
 	// column "lastclock"
 	if (isset($db_item['lastclock'])) {
@@ -467,6 +507,32 @@ while ($db_item = DBfetch($db_items)) {
 	// column "lastvalue"
 	$lastvalue = formatItemValue($db_item);
 
+	if(!empty($_REQUEST['select_val'])) {
+		switch ($_REQUEST['select_val_opts']) {
+			case LATEST_DATA_MATCH_SUBSTRING:
+				$zbx_match = zbx_stristr($lastvalue, $_REQUEST['select_val']);
+				break;
+			case LATEST_DATA_MATCH_NOT_SUBSTRING:
+				$zbx_match = !zbx_stristr($lastvalue, $_REQUEST['select_val']);
+				break;
+			case LATEST_DATA_MATCH_REGEX:
+				$zbx_match = preg_match('|'.$_REQUEST['select_val'].'|', $lastvalue);
+				break;
+			case LATEST_DATA_MATCH_NOT_REGEX:
+				$zbx_match = !preg_match('|'.$_REQUEST['select_val'].'|', $lastvalue);
+				break;
+		}
+	}
+	else {
+		$zbx_match = true;
+	}
+
+	// Remove items from application if the value doesn't match the filter
+	if(!$zbx_match) {
+		$db_host['item_cnt']--;
+		continue;
+	}
+
 	// column "change"
 	$digits = ($db_item['value_type'] == ITEM_VALUE_TYPE_FLOAT) ? 2 : 0;
 	if (isset($db_item['lastvalue']) && isset($db_item['prevvalue'])
@@ -499,6 +565,7 @@ while ($db_item = DBfetch($db_items)) {
 	}
 
 	$item_status = $db_item['status'] == ITEM_STATUS_NOTSUPPORTED ? 'unknown' : null;
+	if ((isset($showAll) && (empty($apps) || isset($apps[0]))) || (isset($hideAll) && !isset($apps[0]) && !empty($apps))) {
 	array_push($app_rows, new CRow(array(
 		SPACE,
 		is_show_all_nodes() ? ($db_host['item_cnt'] ? SPACE : get_node_name_by_elid($db_item['itemid'])) : null,
@@ -509,6 +576,7 @@ while ($db_item = DBfetch($db_items)) {
 		new CCol($change, $item_status),
 		new CCol($actions, $item_status)
 	)));
+    }
 }
 unset($app_rows);
 unset($db_host);
@@ -548,25 +616,26 @@ foreach ($db_hosts as $hostid => $db_host) {
 	$url.= url_param('groupid').url_param('hostid').url_param('fullscreen').url_param('select');
 	$link = new CLink($img,$url);
 
+    if ($db_host['item_cnt'] != 0) {
+		$col = new CCol(array(bold('- '.('other').' -'), SPACE.'('._n('%1$s Item', '%1$s Items', $db_host['item_cnt']).')'));
+		$col->setColSpan(5);
 
-	$col = new CCol(array(bold('- '.('other').' -'), SPACE.'('._n('%1$s Item', '%1$s Items', $db_host['item_cnt']).')'));
-	$col->setColSpan(5);
+		// host JS menu link
+		$hostSpan = null;
+		if ($_REQUEST['hostid'] == 0) {
+			$hostSpan = new CSpan($host['name'], 'link_menu menu-host');
+			$scripts = $hostScripts[$host['hostid']];
+			$hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
+		}
 
-	// host JS menu link
-	$hostSpan = null;
-	if ($_REQUEST['hostid'] == 0) {
-		$hostSpan = new CSpan($host['name'], 'link_menu menu-host');
-		$scripts = $hostScripts[$host['hostid']];
-		$hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
+		$table->addRow(array(
+			$link,
+			get_node_name_by_elid($db_host['hostid']),
+			$hostSpan,
+			$col
+		));
 	}
 
-	$table->addRow(array(
-		$link,
-		get_node_name_by_elid($db_host['hostid']),
-		$hostSpan,
-		$col
-	));
-
 	foreach($app_rows as $row)
 		$table->addRow($row);
 }
