Examples of MessageResult


Examples of org.graylog2.restclient.models.api.results.MessageResult

    }

    public Result recentMessage(String nodeId, String inputId, Boolean filtered) {
        try {
            Node node = nodeService.loadNode(nodeId);
            MessageResult recentlyReceivedMessage = node.getInput(inputId).getRecentlyReceivedMessage(nodeId);

            if (recentlyReceivedMessage == null) {
                return notFound();
            }

            Map<String, Object> result = Maps.newHashMap();
            result.put("id", recentlyReceivedMessage.getId());
            result.put("index", recentlyReceivedMessage.getIndex());
            if (filtered)
                result.put("fields", recentlyReceivedMessage.getFilteredFields());
            else
                result.put("fields", recentlyReceivedMessage.getFields());

            return ok(Json.toJson(result));
        } catch (IOException e) {
            return status(500);
        } catch (APIException e) {
View Full Code Here

Examples of org.graylog2.restclient.models.api.results.MessageResult

    public Result newExtractor(String nodeId, String inputId, String extractorType, String field, String exampleIndex, String exampleId) {
        try {
            Node node = nodeService.loadNode(nodeId);
            Input input = node.getInput(inputId);
            MessageResult exampleMessage = messagesService.getMessage(exampleIndex, exampleId);
            String example = exampleMessage.getFields().get(field).toString();

            return ok(views.html.system.inputs.extractors.new_extractor.render(
                            currentUser(),
                            standardBreadcrumbs(node, input),
                            node,
View Full Code Here

Examples of org.graylog2.restclient.models.api.results.MessageResult

        } catch (InvalidRangeParametersException e) {
            return null; // cannot happen(tm)
        }
        List<MessageResult> messages = search.search().getMessages();

        MessageResult result;
        if (messages.size() > 0) {
            return messages.get(0);
        } else {
            return null;
        }
View Full Code Here

Examples of org.graylog2.restclient.models.api.results.MessageResult

        return 0;
    }
    public MessageResult getMessage(String index, String id) throws IOException, APIException {
        final GetMessageResponse r = api.path(routes.MessageResource().search(index, id), GetMessageResponse.class)
                .execute();
    return new MessageResult(r.message, r.index, Maps.<String, List<HighlightRange>>newHashMap(), fieldMapper);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.