Package com.splunk

Examples of com.splunk.ResponseMessage


    static void run(String[] args) throws IOException {
        Command command = Command.splunk("test").parse(args);
        Service service = Service.connect(command.opts);

        String path = command.args.length > 0 ? command.args[0] : "/";
        ResponseMessage response = service.get(path);

        int status = response.getStatus();
        System.out.println(String.format("=> %d", status));
        if (status != 200) return;

        BufferedReader reader = new BufferedReader(
            new InputStreamReader(response.getContent(), "UTF-8"));
        while (true) {
            String line = reader.readLine();
            if (line == null) break;
            System.out.println(line);
        }
View Full Code Here

TOP

Related Classes of com.splunk.ResponseMessage

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.