Code Monkey home page Code Monkey logo

fileparser's Introduction

Introduction

Create a console application to parse a log csv file and print out logs based on a custom query. Use the attached csv file to work with.

Getting Started

TODO:

  1. Build solution that is able to search any column by full or partial text string. Example: "signatureId=’Microsoft-Windows-Security-Auditing:4608’“ or "signatureId=’4608’“ should return all the logs from the file. This functionality should work with all columns. if column is not found return "column not found. Query should be provided by user input. Query syntax can be in free form. Example:
    [column_name = ‘search_string’] or [select FROM collum_name WHERE text=’search_string’]
  2. Results from the query should be combined and returned in JSON format. Example see bellow.
  3. Submit your code to a github repository.

Bonus points:

  • Add Boolean logical operator support in the queries;
  • Add multiple file support;
  • Add log count value in the resulting JSON output;

Extra bonus points:

  • Improvements are welcome 😊. For example: Deal with duplicates, combine results in a more readable format.
  • Implement database layer. Save results in a database of your choice.
  • Implement options to send alerts based on the severity of the log. No need to actually send the notification, you can use Console.WriteLine().

JSON Example

{
	"searchQuery": "deviceVendor='Microsoft'",
	"result": [{
			"deviceVendor": "Microsoft",
			"deviceProduct": "Windows Vista",
			"deviceVersion": 1,
			"signatureId": "Microsoft-Windows-Security-Auditing:4896",
			"severity": 5,
			"name": "One or more rows have been deleted from the certificate database.",
			"start": "2022-05-29T04:53:43.560000Z",
			"rt": "1653800023.56",
			"msg": "One or more rows have been deleted from the certificate database.",
			"shost": "DESKTOP-FQYFQMDY9RGD",
			"smac": "60:6C:66:8a:4c:a5",
			"dhost": "w2019r2008-srv",
			"dmac": "38:00:25:b4:b0:3f",
			"suser": "RIesa",
			"suid": null,
			"externalId": 4896,
			"cs1Label": "payload",
			"cs1": "",
			"sproc": ""
		},
		{
			"deviceVendor": "Microsoft",
			"deviceProduct": "Windows Vista",
			"deviceVersion": 1,
			"signatureId": "Microsoft-Windows-Security-Auditing:4624",
			"severity": 3,
			"name": "An account was successfully logged on.",
			"start": "2022-05-29T04:54:16.359000Z",
			"rt": "1653800056.359",
			"msg": "This event is generated when a logon session is created.",
			"shost": "LENOVO-TZJUVSD7H",
			"smac": "E4:A7:A0:65:60:dd",
			"dhost": "w2014r2010-srv",
			"dmac": "D8:3B:BF:0d:02:5a",
			"suser": "LENOVO-TZJUVSD7H$",
			"suid": 5e+188,
			"externalId": 4624,
			"cs1Label": "payload",
			"cs1": "",
			"sproc": ""
		}
	]
}

fileparser's People

Watchers

Oleksii Anisenko 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.