def common_filters(marker=None, limit=None, sort_key=None, sort_dir=None):
    """Generate common filters for any list request.

    :param marker: entity ID from which to start returning entities.
    :param limit: maximum number of entities to return.
    :param sort_key: field to use for sorting.
    :param sort_dir: direction of sorting: 'asc' or 'desc'.
    :returns: list of string filters.
    """
    filters = []
    if isinstance(limit, int):
        filters.append('filters.field=limit')
        filters.append('filters.value=%d' % limit)
    if marker is not None:
        filters.append('filters.field=marker')
        filters.append('filters.value=%s' % marker)
    if sort_key is not None:
        filters.append('filters.field=sort_key')
        filters.append('filters.value=%s' % sort_key)
    if sort_dir is not None:
        filters.append('filters.field=sort_dir')
        filters.append('filters.value=%s' % sort_dir)
    return filters