Handling multiline formats in splunk - splunk

I am not sure of how to set the BREAK_ONLY_BEFORE
I have try setting
BREAK_ONLY_BEFORE: date
but it throws error
My logs are :
[2022-04-05 11:18:23,839] WARN Error while loading: connectors-versions.properties (com.amadeus.scp.kafka.connect.utils.Version)
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at com.amadeus.scp.kafka.connect.utils.Version.<clinit>(Version.java:47)
at com.amadeus.scp.kafka.connect.connectors.kafka.source.router.K2KRouterSourceConnector.version(K2KRouterSourceConnector.java:62)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:380)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:385)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:355)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:328)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:261)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:253)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:222)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:199)
at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:60)
at org.apache.kafka.connect.cli.ConnectDistributed.startConnect(ConnectDistributed.java:91)
at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:78)
As of now the logs are send to splunk as different events.
Please let me know if anyone has used this option before.

The better method is to set LINE_BREAKER to a regular expression that defines the start of each event. These props.conf settings should do it.
[mysourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)\[\d{4}-\d\d
TIME_PREFIX = \[
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
MAX_TIMESTAMP_LOOKAHEAD = 23
If you really want to use BREAK_ONLY_BEFORE then try these settings:
[mysourcetype]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE_DATE = false
BREAK_ONLY_BEFORE = ([\r\n]+)\[\d{4}-\d\d
TIME_PREFIX = \[
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
MAX_TIMESTAMP_LOOKAHEAD = 23

Related

Spacevim: neosnippet <Plug> mappings dont work

Problem
I set up my spacevim with builtin autocompletion which provides neosnippet in-box, but when I use my Enter button to perform expansion of a snippet I get just raw output of <Plug>(neosnippet_expand). Also, I've tried to use deoppet snippets, but faced with the same problem. Besides, i tried to remap my how in this post How to autoexpand neosnippet with deoplete dropdown menu? but when I try to expand main I got main<Plug>(neosnippet_expand_or_jump) Here are my configs:
Init.toml:
[options]
# set spacevim theme. by default colorscheme layer is not loaded,
# if you want to use more colorscheme, please load the colorscheme
# layer
colorscheme = "nord"
colorscheme_bg = "dark"
default_indent = 4
expand_tab = false
# snippet_engine = "neosnippet"
# Disable guicolors in basic mode, many terminal do not support 24bit
# true colors
enable_guicolors = true
# Disable statusline separator, if you want to use other value, please
# install nerd fonts
statusline_separator = "arrow"
statusline_iseparator = "arrow"
buffer_index_type = 4
enable_tabline_filetype_icon = true
enable_statusline_mode = false
autocomplete_parens = false
automatic_update = true
# Enable autocomplete layer
[[layers]]
name = 'autocomplete'
# autocomplete_method = 'coc'
auto_completion_tab_key_behavior = "smart"
auto_completion_return_key_behavior = "smart"
Init.vim:
map <F5> :ImportName<CR>
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/main.vim'
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option("num_processes", 4)
let g:spacevim_enable_ycm = 1
let g:ansible_extra_keywords_highlight = 1
let g:coc_filetype_map = {
\ 'yaml.ansibe': 'ansible',
\ }
let g:jedi#completions_enabled = 0
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
autocmd FileType yaml\|yaml.ansible setlocal ts=2 sts=2 sw=2 expandtab
inoremap <silent><expr><CR> pumvisible() ? deoplete#close_popup()."\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
Snippets dir list:
╰─$ ls ~/.SpaceVim.d/snippets/
actionscript.snip blade.snip d.snip go.snip liquid.snip objc.snip rust.snip systemverilog.snip vim.snip
ada.snip clojure.snip elixir.snip go.vim lua.snip ocaml.snip scala.snip tex.snip vimspec.snip
apache.snip cmake.snip elm.snip groovy.snip make.snip perl.snip scheme.snip toml.snip vimwiki.snip
applescript.snip coffee.snip erlang.snip haskell.snip markdown.snip php.snip scss.snip twig.snip vue.snip
asciidoc.snip cpp.snip eruby.snip html.snip mediawiki.snip prolog.snip sh.snip typescriptreact.snip xhtml.snip
asciidoctor.snip c.snip fortran.snip javascript.snip mkd.snip python.snip _.snip typescript.snip zsh.snip
asm.snip cs.snip fsharp.snip java.snip moon.snip rails.snip sql.snip verilog.snip
beancount.snip css.snip Gemfile.snip julia.snip neosnippet.snip rst.snip sshconfig.snip vim
bib.snip cuda.snip gnuplot.snip kp19pp.snip nim.snip ruby.snip swift.snip vimshell.snip
Completion sight (if needed):
I want to expand neosnippet snippets, but fail

Changes in lua language cause error in ai script

When I run script in game, I got an error message like this:
.\AI\haick.lua:104: bad argument #1 to 'find' (string expected, got nill)
local haick = {}
haick.type = type
haick.tostring = tostring
haick.require = require
haick.error = error
haick.getmetatable = getmetatable
haick.setmetatable = setmetatable
haick.ipairs = ipairs
haick.rawset = rawset
haick.pcall = pcall
haick.len = string.len
haick.sub = string.sub
haick.find = string.find
haick.seed = math.randomseed
haick.max = math.max
haick.abs = math.abs
haick.open = io.open
haick.rename = os.rename
haick.remove = os.remove
haick.date = os.date
haick.exit = os.exit
haick.time = GetTick
haick.actors = GetActors
haick.var = GetV
--> General > Seeding Random:
haick.seed(haick.time())
--> General > Finding Script Location:
local scriptLocation = haick.sub(_REQUIREDNAME, 1, haick.find(_REQUIREDNAME,'/[^\/:*?"<>|]+$'))
Last line (104 in file) causes error and I don`t know how to fix it.
There are links to .lua files below:
https://drive.google.com/file/d/1F90v-h4VjDb0rZUCUETY9684PPGw7IVG/view?usp=sharing
https://drive.google.com/file/d/1fi_wmM3rg7Ov33yM1uo7F_7b-bMPI-Ye/view?usp=sharing
Help, pls!
When you use a function in Lua, you are expected to pass valid arguments for the function.
To use a variable, you must first define it, _REQUIREDNAME in this case is not available, haick.lua file is incomplete. The fault is of the author of the file.
Lua has a very useful reference you can use if you need help, see here

Unable to write Dynamicframe without header

Hello I am converting a parquet file to csv and wanna write it without header. I have followed this document.
Below is my code:
datasink3 = applymapping1.coalesce(1)
datasink2 = glueContext.write_dynamic_frame.from_options(frame = datasink3, connection_type = "s3", connection_options = {"path": "s3://saphana12/output1"}, format = "csv", format_options = {"writeHeader":'false',"quoteChar":'-1',"separator":'|'}, transformation_ctx = "datasink2")
I see the headers are still appearing.
Am I doing something wrong?
Kindly help me out in this
use {"writeHeader": False,"quoteChar":'-1',"separator":'|'}, transformation_ctx = "datasink2")
Instead of declaring 'false' declare False as it is boolean

How do you configure UDPInput to work with heka-flood udp test

I am trying to test sending data to heka's UDPInput with no success. I decided to try to use the heka-flood tool to mimic UPD traffic also with no success. I am using 0.10 version of heka. My heka.toml :
[UdpInput]
address = "127.0.0.1:4880"
net = "udp"
splitter = "udp_splitter"
decoder = "ProtobufDecoder"
set_hostname = true
# I have also tried not setting this as well
[udp_splitter]
type = "HekaFramingSplitter"
[ProtobufDecoder]
[LogOutput]
type = "LogOutput"
message_matcher = "Logger == 'UdpInput'"
encoder = "PayloadEncoder"
and my flood.toml:
[udp_proto]
ip_address = "127.0.0.1:4880"
sender = "udp"
pprof_file = ""
encoder = "protobuf"
num_messages = 1000
corrupt_percentage = 0.0001
signed_percentage = 0.00011
variable_size_messages = false
ascii_only = true
max_message_size = 32000
If I add another input, like say a log tailer and add it to the message matcher for the LogOutput, those messages end up being logged out. I never see anything from the UpdInput. What am I doing wrong?

parse_failed error occured in augeas,why this error occur and how to fix this issue?

I want to edit file "myfileDB.properties" using augeas. so used Properties.lns.
but it made error "parse_failed"and some time "parse_skel_failed". explain the root cause of this error and solve this issue.
augtool> print /augeas/files/root/yog/myfileDB.properties/error/
/augeas/files/root/yog/myfileDB.properties/error = "parse_failed"
/augeas/files/root/yog/myfileDB.properties/error/pos = "17835"
/augeas/files/root/yog/myfileDB.properties/error/line = "318"
/augeas/files/root/yog/myfileDB.properties/error/char = "0"
/augeas/files/root/yog/myfileDB.properties/error/lens = "/usr/share /augeas/lenses/dist/properties.aug:50.25-.100:"
/augeas/files/root/yog/myfileDB.properties/error/message = "Iterated lens matched less than it should"
/augeas/files/root/yog/myfileDB.properties/error = "parse_skel_failed"
/augeas/files/root/yog/myfileDB.properties/error/pos = "4844943"
/augeas/files/root/yog/myfileDB.properties/error/line = "53707"
/augeas/files/root/yog/myfileDB.properties/error/char = "0"
/augeas/files/root/yog/myfileDB.properties/error/lens = "/usr/share/augeas/lenses/dist/simplevars.aug:34.10-.46:"
/augeas/files/root/yog/myfileDB.properties/error/message = "Iterated lens matched less than it should"