GrokProcessor { public Map<String, Object> parse(final String input) { final Match m = instance.match(input); if (m == Match.EMPTY) { return ImmutableMap.of(); } m.captures(); return m.toMap(); } @JsonCreator  GrokProcessor(
        @JsonProperty("patterns") Map<String, String> patterns,
        @JsonProperty("pattern") String pattern
    ); Map<String, Object> parse(final String input);  }
@Test public void testHost() throws Exception { final GrokProcessor grok = new GrokProcessor(ImmutableMap.of(), "%{pod}-%{role}-%{pool}\\.%{site}\\.%{domain}"); Assert.assertEquals( ImmutableMap.of("pod", "sto1", "role", "example", "pool", "a1", "site", "sto", "domain", "example.com"), grok.parse("sto1-example-a1.sto.example.com")); }