Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose cache setting in UserAgentPlugin #46533

Merged
merged 4 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/reference/ingest/processors/user-agent.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,14 @@ In practice, it will make most sense for any custom regex file to be a variant o
or a customised version.

The default file included in `ingest-user-agent` is the `regexes.yaml` from uap-core: https://github.com/ua-parser/uap-core/blob/master/regexes.yaml

[[ingest-user-agent-settings]]
===== Node Settings

The `user_agent` processor supports the following setting:

`ingest.user_agent.cache_size`::

The maximum number of results that should be cached. Defaults to `1000`.

Note that these settings are node settings and apply to all `user_agent` processors, i.e. there is one cache for all defined `user_agent` processors.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.nio.file.StandardOpenOption;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

Expand Down Expand Up @@ -86,4 +87,8 @@ static Map<String, UserAgentParser> createUserAgentParsers(Path userAgentConfigD
return Collections.unmodifiableMap(userAgentParsers);
}

@Override
public List<Setting<?>> getSettings() {
return Collections.singletonList(CACHE_SIZE_SETTING);
}
}