Package com.splunk

Examples of com.splunk.Args


        Service service = Service.connect(command.opts);

        // Check the syntax of the query.
        try {
            Args parseArgs = new Args("parse_only", true);
            service.parse(query, parseArgs);
        }
        catch (HttpException e) {
            String detail = e.getDetail();
            Command.error("query '%s' is invalid: %s", query, detail);
View Full Code Here


        return createNode(name, name);
    }

    private Node createNode(String displayName, String app) {
        // Clone the root service, scoped to the requested namespace
        Args args = new Args();
        args.put("host", service.getHost());
        args.put("port", service.getPort());
        args.put("scheme", service.getScheme());
        args.put("username", service.getUsername());
        args.put("password", service.getPassword());
        args.put("app", app);
        args.put("owner", "-");
        Service scope = Service.connect(args);

        Node node = new ExplorerNode(scope, new NamespaceKids(scope));
        node.setDisplayName(displayName);
        return node;
View Full Code Here

        Service service = Service.connect(command.opts);

        // Check the syntax of the query.
        try {
            Args parseArgs = new Args("parse_only", true);
            service.parse(query, parseArgs);
        }
        catch (HttpException e) {
            String detail = e.getDetail();
            Command.error("query '%s' is invalid: %s", query, detail);
        }

        // Create the oneshot search query & query arguments.
        Args queryArgs = new Args();
        if (earliestTime != null)
            queryArgs.put("earliest_time", earliestTime);
        if (fieldList != null)
            queryArgs.put("field_list", fieldList);
        if (latestTime != null)
            queryArgs.put("latest_time", latestTime);
        if (statusBuckets > 0)
            queryArgs.put("status_buckets", statusBuckets);
        queryArgs.put("output_mode", outputMode);

        // Execute the oneshot query, which returns the stream (i.e. there is
        // no search job created, just a one time search)
        InputStream stream = service.oneshotSearch(query, queryArgs);
View Full Code Here

        }
        }
    }

    private Args buildSplunkArgs() {
        Args args = new Args();
        if (endpoint.getConfiguration().getSourceType() != null) {
            args.put("sourcetype", endpoint.getConfiguration().getSourceType());
        }
        if (endpoint.getConfiguration().getSource() != null) {
            args.put("source", endpoint.getConfiguration().getSource());
        }
        return args;
    }
View Full Code Here

TOP

Related Classes of com.splunk.Args

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.