Git Product home page Git Product logo

bulk-asset-upload's Introduction

Disclaimer

This script is provided with no guarantees, warranties, or herbal teas. It was written in a hurry by someone with no professional Python coding experience. It worked in my very limited testing, but it might require tweaks or updates to work for you.

Overview

Graylog 5.2 includes a new Asset Database plugin which allows you to define machine and user assets and correlate those assets with your incoming log data. At release, it supports entering assets manually or importing from either LDAP or Active Directory. However, many people who don't have an LDAP or AD server do have way more machines than they care to enter manually. So I built this script to import machine and user assets in bulk from a .csv file.

Instructions

The most important thing to mention is that the script expects your .csv file to be organized exactly like the provided sample_machine_upload.csv and sample_user_upload.csv files. If the data is not in the expected columns, the script will not work.

I highly recommend you use sample_machine_upload.csv or sample_user_upload.csv as a starting point. Load it up in your favorite spreadsheet program, delete the non-header rows, and fill in with your own data.

python3 upload-assets.py -h

usage: upload-assets.py [-h] (--user | --machine) [--https] [-s SERVER] [-p PORT] -k APIKEY -f FILE [--noheader]

Bulk import assets from a .csv file to Graylog Security

optional arguments:
  -h, --help            show this help message and exit
  --user                Upload user assets
  --machine             Upload machine assets
  --https               Use https (as opposed to http)
  -s SERVER, --server SERVER
                        The host where Graylog is running (default to localhost)
  -p PORT, --port PORT  The port Graylog is listening on (default to 9000 for HTTP, not used for HTTPS)
  -k APIKEY, --apikey APIKEY
                        The API key for accessing the Graylog API
  -f FILE, --file FILE  The .csv file to read data from
  --noheader            The .csv file has no column headers, there is data in the first row

bulk-asset-upload's People

Contributors

waab76 avatar

Watchers

 avatar  avatar  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.