@Override
    public String exec(Tuple input) throws IOException {
        if ( input == null || input.size() == 0 || input.get(0) == null ) {
            return null;
        }

        String uriStr = (String) input.get(0);
        //danger, assumes lower-case
        if ( !(uriStr.startsWith("http://") || uriStr.startsWith("https://")) ) {
            uriStr = "http://" + uriStr;
        }
        try {
            URI uri = new URI(uriStr);
            return uri.getHost();
        } catch ( URISyntaxException uriSE ) {
            //"fuzzy" match
            Matcher m = URI_PATTERN.matcher(uriStr);
            if ( m.matches() ) {
                return m.group(2);
            }
            return null;
        } catch ( Throwable t ) {
            t.printStackTrace();
            throw WrappedIOException.wrap("Could not process tuple: " + input, t);
        }
    }