CyberArk community: PTA - Syslog messages from Vault not parsing correctly and causing error in diamond log
CyberArk Privileged Access Manager - Self-Hosted
└ Administrator
└ Components
└ Digital Vault
CyberArk community: PTA - Syslog messages from Vault not parsing correctly and causing error in diamond log
CyberArk Privileged Access Manager - Self-Hosted
└ Administrator
└ Components
└ Digital Vault
| #!/bin/env python | |
| import json | |
| import urllib.request | |
| import argparse | |
| def by_class(all_fields_to_depth): | |
| url = "https://raw.githubusercontent.com/ocsf/ocsf-lib-py/main/schema_cache/schema-1.3.0.json" | |
| schema = json.loads(urllib.request.urlopen(url).read().decode('utf-8')) |
| # git aliases - taken from oh-my-zsh's git plugin and translated to bash | |
| # https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks | |
| # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
| function git_current_branch() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ | |
| ref=$(git rev-parse --short HEAD 2> /dev/null) || return | |
| echo ${ref#refs/heads/} | |
| } | |
| function git_current_repository() { | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || \ |
| # PURPOSE ###################################################################### | |
| # This exercise aims not to practice or build skills, but to quickly identify | |
| # topics and details of the Ruby language for further review. It intentionally | |
| # ranges from easy to things that are probably hard or unknown. | |
| # INSTRUCTIONS ################################################################# | |
| # There are 70 small tasks. Aim to spend one hour on them. If you don't know the | |
| # answer just move on. If you are unsure of the syntax just guess. Answer |
| #!/bin/bash | |
| LC_ALL=C exec sort "$@" |
| #!/bin/bash | |
| if [ -z "$1" ] || [ "$1" = "--help" ]; then | |
| echo "extralf: Extra Line Feed - select files with EOL-EOL-EOF" | |
| echo "Usage: extralf FILE [FILE] [FILE]..." | |
| echo "Example: find . -name '*.rb' | xargs extralf" | |
| else |
| -- show table and index bloat in your database ordered by most wasteful | |
| -- https://github.com/heroku/heroku-pg-extras/blob/master/init.rb | |
| WITH constants AS ( | |
| SELECT current_setting('block_size')::numeric AS bs, 23 AS hdr, 4 AS ma | |
| ), bloat_info AS ( | |
| SELECT | |
| ma,bs,schemaname,tablename, | |
| (datawidth+(hdr+ma-(case when hdr%ma=0 THEN ma ELSE hdr%ma END)))::numeric AS datahdr, | |
| (maxfracsum*(nullhdr+ma-(case when nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2 | |
| FROM ( |
| require "json" | |
| JSON.parse(`. /etc/credentials.sh; ruby -rjson -e'puts ENV.to_hash.to_json'`).each_pair { |k,v| ENV[k] = v } |