thekrakken / java-grok

Simple API that allows you to easily parse logs and other files
http://grok.nflabs.com/
Other
360 stars 151 forks source link

Discovery feature doesn't work properly #54

Open Aleyasen opened 8 years ago

Aleyasen commented 8 years ago

I tried to use discovery feature, I am not sure that I used it in the correct way, but the method always returned the exact input string. I'll be thankful if you guide how I should use it. Please consider a simple test in the following, the out variable will be 1234 in this test.


    @Test
    public void dtest() {
        try {
            Grok g = Grok.create(ResourceManager.PATTERNS);
            Discovery disc = new Discovery(g);

            final String out = disc.discover("1234");
            System.out.println("discovered type=" + out);

        } catch (GrokException ex) {
            Logger.getLogger(DiscoveryTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }