Created
October 30, 2018 12:27
-
-
Save oxidizeddreams/26a1530ea6ea6cdbd9886602007ae00f to your computer and use it in GitHub Desktop.
sumologic cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SumoLogic CheatSheet | |
# Algorithms | |
A. Luhn - Luhn’s algorithm to check message logs for strings of numbers that may be credit card numbers and then validates them. It takes a string as an input, strips out all characters that are not numerals, and checks if the resulting string is a valid credit card number, returning true or false accordingly | |
1. Syntax | |
- luhn(<field>) [as <field>] | |
- luhn("<input string>") [as <field>] | |
2. Example | |
`| parse regex "(?<maybecc>\d{4}-\d{4}-\d{4}-\d{4})" nodrop` | |
`| parse regex "(?<maybecc>\d{4}\s\d{4}\s\d{4}\s\d{4})" nodrop` | |
`| parse regex "(?<maybecc>\d{16})" nodrop` | |
`| if (luhn(maybecc), true, false) as valid` | |
B. transaction | |
# Graphs | |
A. transpose | |
1. Syntax | |
- transpose row [<field_1>] column [<field_n>] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment