---
title: "FKM Plugin - How to show only the last error message for each key in FKM"
description: "The FKM plugin can limit the number of error messages shown per key using the maxConditionsPerKey property. Defining multiple specific keys and enabling maxConditionsPerKey ensures only the latest error message for each key appears in the dataview."
url: "https://docs.itrsgroup.com/docs/faq/geneos/9330398032797-geneos-fkm-plugin-how-to-show-only-the-last-error-message-for-each-key-in-fkm/index.html"
---
maxConditionsPerKey property will limit the number of errors shown in the dataview for each of the defined keys

Whether using FKM tables to define keys or defining FKM keys in the sampler itself, it is important to remember that the order the keys are defined will be the order that the keys will be evaluated.

Example:

1. If you want FKM to distinguish different errors, you need to define a key for each one. This could be an FKM table:

    ![Geneos FKM table](https://docscdn.itrsgroup.com/faq/images/geneos/Geneos-FKM-Plugin-How-to-show-only-the-last-error-message-for-each-key-in-FKM.png)

    The order in this table matters. FKM evaluates keys from top to bottom, once it finds a matching key, it stops evaluating them. This is the reason why we will define Ignore keys before error keys. Also, this is why the more generic keys like "ERROR" have to be the last.

2. Enable [maxConditionsPerKey](https://docs.itrsgroup.com/docs/geneos/current/collection/fkm-config/index.html#maxconditionsperkey) parameter. This is the key component that will help us achieve our goal. It will show only the latest log line that matched the key. But because of this, it is more important than ever to define multiple keys and not only a generic one.

    ![Geneos FKM Max Condition Per Key](https://docscdn.itrsgroup.com/faq/images/geneos/Geneos-max-condition-per-key.png)

    After echoing each error multiple times to the log file we can see that only one line is showed per key in the dataview.

    ![Geneos FKM Log File](https://docscdn.itrsgroup.com/faq/images/geneos/Geneos-FKM-Plugin-How-to-show-only-the-last-error-message-for-each-key-in-FKM-cli.png)

    This is the resulting dataview with both settings configured:

    ![Geneos FKM Example Dataview Settings Configuration](https://docscdn.itrsgroup.com/faq/images/geneos/Geneos-FKM-Plugin-How-to-show-only-the-last-error-message-for-each-key-in-FKM-dataview-settings.png)

[FKM Example.xml](/faq/downloads/geneos/FKM_example.xml "Download the FKM Example")

[FKM Table 1.xml](/faq/downloads/geneos/FKM_table_1.xml "Download the FKM table 1")


