def format_generic_string(event_value, attribute):
    """
    Creates a filter format string for a generic attribute.

    :param str event_value: String that is used to generate the filter string.
    :param str attribute: The attribute that is used in the filter.
    :return: A string that can be used in a LQL filter.
    """
    if event_value.lower() == "exists":
        return "{0:s} IS NOT NULL".format(attribute)

    if event_value.startswith("!"):
        return "{0:s} NOT LIKE '%{1:s}%'".format(attribute, event_value[1:])

    return "{0:s} LIKE '%{1:s}%'".format(attribute, event_value)