Giter Club home page Giter Club logo

logpoint_api's Introduction

LogpointApi

Elixir library implementing the Logpoint API reference.

Installation

def deps do
  [
    {:logpoint_api, github: "MikaelFangel/logpoint_api", tag: "v0.2.2"}
  ]
end

Example Usage

Examples on how to use the library where all examples assumes the following variables are set:

ip = "127.0.0.1"

creds = %LogpointApi.Credential{
  username: "admin",
  secret_key: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
}

It's expected that you have included this repo into your mix project (see installation). Furthermore, module definitions, docs, and so forth have been excluded from the examples for brevity.

Run Search

This will create a search_id and then retrieve and return the result.

query = LogpointApi.SearchApi.Query{
  query: "user=*",
  limit: 100,
  repos: ["127.0.0.1:5504"],
  time_range [1_714_986_600, 1_715_031_000]
}

LogpointApi.run_search(ip, creds, query)

Get a Search ID

This will create the search and return its id if successfull.

query = LogpointApi.SearchApi.Query{
  query: "user=*",
  limit: 100,
  repos: ["127.0.0.1:5504"],
  time_range [1_714_986_600, 1_715_031_000]
}

LogpointApi.IncidentApi.get_search_id(ip, creds, query)

Retrieve a Search from a Search ID

This will retrieve the result of a given search ID. Be aware if the final key in the result map is false the search hasn't completed yet, and you need to fetch again. Otherwise, if the key success is false you need to recreate the search and try to retrieve it again.

LogpointApi.IncidentApi.get_search_result(ip, creds, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA")

Contributing

Please refer to CONTRIBUTING.md.

logpoint_api's People

Contributors

mikaelfangel avatar dependabot[bot] avatar philipcramer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.