8:30 AM
Xylakant
the video is like 3 years old.
8:31 AM
mungustas
so to get to the point, could you make one example how to use ‘custom pattern’ and match something, I think I will understand it
8:32 AM
pafmaf joined the channel
8:55 AM
cyborg-one has quit
8:56 AM
valeech joined the channel
8:59 AM
valeech has quit
9:00 AM
hugh_jass has quit
9:00 AM
hugh_jass joined the channel
9:06 AM
Cyber-WarDaddy has quit
9:09 AM
pc99096_ joined the channel
9:10 AM
(?:%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp8601})
9:10 AM
20160829173716
9:10 AM
I have a rsyslog customization with timestamp
9:10 AM
$template ConvertToTimestamps,"%timereported:::date-mysql% %HOSTNAME% %syslogtag% %msg%\n"
9:11 AM
is there a “date-mysql” pattern already ?
9:12 AM
pc99096 has quit
9:12 AM
Schwarzbaer_ has quit
9:14 AM
koendc has quit
9:14 AM
derjohn_mob has quit
9:15 AM
notebox joined the channel
9:17 AM
Gnomethrower joined the channel
9:21 AM
notebox has quit
9:25 AM
as I figured only this solution: %{YEAR}%{MONTHNUM}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND}
9:26 AM
koendc joined the channel
9:30 AM
hugh_jass has quit
9:30 AM
hugh_jass joined the channel
9:39 AM
as for ‘custom patterns’
9:40 AM
9:41 AM
%{YEAR}%{MONTHNUM}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND} %{SYSLOGHOST} %{SYSLOGPROG}
9:42 AM
derjohn_mob joined the channel
9:42 AM
now next for queueid I would like to use custom pattern and include that
9:42 AM
8F1C9404FEDE
9:42 AM
# common postfix patterns
9:42 AM
POSTFIX_QUEUEID ([0-9A-F]{6,}|[0-9a-zA-Z]{15,})
9:56 AM
I am stuck after this, not sure why it doesn’t match
9:57 AM
bjorn_
Works for me
9:59 AM
Darnovc
Hello, there is translate plugin which can use nested yaml dictionary in filter, but is there a way to value of specific field inside it ?
10:00 AM
notebox joined the channel
10:00 AM
hugh_jass has quit
10:00 AM
hugh_jass joined the channel
10:01 AM
this is my nested dictionary, in translate plugin: E001: {T001: {P001: asd, P002: qwe}}, can i have only value of P001 from logstash ?
10:01 AM
N-Mi joined the channel
10:01 AM
right now i am only getting all content when i am sending "E001" message
10:02 AM
descrepes_ has quit
10:03 AM
descrepes joined the channel
10:06 AM
notebox has quit
10:10 AM
mungustas
bjorn_: how do I match next value ? queueid
10:12 AM
bjorn_
Just like you have written
10:13 AM
I entered your queue ID and your pattern in grokdebug, and it gave the expected result.
10:14 AM
mungustas
emm but when there’s a longer line
10:15 AM
bjorn_
Try it
10:15 AM
fev3r101 has quit
10:15 AM
mungustas
20160829173716 mailer-post10
mail4.tld.com/smtp[15831] : 8F1C9404FEDE:
to=<suman@gmail.com> ;, relay=gmail-smtp-in.l.google.com[64.233.167.26]:25, delay=879, delays=122/755/0.26/1.7, dsn=2.0.0, status=sent (250 2.0.0 OK 1472481435 o1si32335596wjh.238 - gsmtp)
10:15 AM
bjorn_
Add the whole line in grokdebug.
10:15 AM
That's the point with debugging.
10:15 AM
mungustas
%{YEAR}%{MONTHNUM}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND} %{SYSLOGHOST} %{SYSLOGPROG}
10:16 AM
bjorn_
Don't paste it here
10:16 AM
mungustas
yeah and now I am banging my head against a wall
10:16 AM
bjorn_
Use grokdebug
10:16 AM
mungustas
how do I match next ?
10:16 AM
bjorn_
"next"?
10:16 AM
mungustas
the queueid
10:16 AM
8F1C9404FEDE
10:16 AM
bjorn_
With POSTFIX_QUEUEID ([0-9A-F]{6,}|[0-9a-zA-Z]{15,}) just like you wrote.
10:17 AM
mungustas
I am not sure if %{SYSLOGPROG} mess it up
10:17 AM
but it doesn’t match
10:17 AM
the queueid
10:17 AM
bjorn_
What does SYSLOGPROG match?
10:18 AM
mungustas
alone ? or with every matcher?
10:18 AM
bjorn_
With your current grok filter in grokdebug
10:20 AM
mungustas
10:20 AM
logstashbot
Title: pastebin - mungustas - post number 3707894 (at pastebin.ca)
10:20 AM
Darnovc
is there a way to access specific field from dictionary in yaml: E001: {T001: {P001: asd, P002: qwe}} from logstash ?
10:22 AM
bjorn_
mungustas: As you can see, the parsed value of SYSLOGPROG is 'mail4.mlsend2.com/smtp[15831]'.
10:22 AM
Agree?
10:22 AM
mungustas
yes
10:23 AM
bjorn_
Then in your filter, add the POSTFIX_QUEUEID pattern after that. But you will need to look closely at your log line, because there are special characters you need to consider.
10:24 AM
mungustas
maybe there’s a Tab char ?!
10:24 AM
bjorn_
You haven't even added POSTFIX_QUEUEID so perhaps you should start doing that
10:25 AM
mungustas
well I did but then it doesn’t match anything
10:25 AM
I pasted in the pastebin until it matches
10:26 AM
bjorn_
It still matches SYSLOGPROG etc, right?
10:26 AM
mungustas
no
10:26 AM
bjorn_
It does when I try.
10:26 AM
mungustas
No Matches
10:26 AM
bjorn_
Using your pattern and log file
10:27 AM
Ah, right.
10:27 AM
mungustas
10:27 AM
bjorn_
%{YEAR}%{MONTHNUM}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND} %{SYSLOGHOST} %{SYSLOGPROG}:\s+%{POSTFIX_QUEUEID}
10:27 AM
mungustas
that’s where I am banging my head :)
10:27 AM
bjorn_
\s means spaces (regular space, tabs, everything)
10:27 AM
+ means one or more
10:28 AM
mungustas
alright!!
10:28 AM
bjorn_
And don't forget the colon after %{SYSLOGPROG}
10:28 AM
mungustas
yeah those there my barier
10:29 AM
first I didn’t match the colon and then didn’t know I needed to look for special chars (tab)
10:29 AM
thanks bro!
10:29 AM
bjorn_
It's probably not tab, just multiple spaces.
10:29 AM
mungustas
maybe
10:30 AM
hugh_jass has quit
10:30 AM
bjorn_
When you're debugging with grokdebug, add one new pattern at a time and make sure it works. Match the result to your pattern/filter.
10:30 AM
hugh_jass joined the channel
10:30 AM
10:31 AM
Then it's your job to add the colon
10:31 AM
mungustas
yeah I was wrong
10:32 AM
do you know if there’s a syslogtimestamp already defined for date-mysql format ?
10:33 AM
I see in example there’s (?:%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp8601})
10:33 AM
bjorn_
10:33 AM
logstashbot
10:33 AM
bjorn_
Everything else must be added by you.
10:33 AM
mungustas
maybe I would not need to write all those year,month,day etc ?
10:34 AM
ah ok I see there isn't
10:35 AM
I guess I just should place it in custom patterns and use it as variable in match
10:36 AM
I am just not sure I have to write all those patterns myself
10:36 AM
10:36 AM
logstashbot
10:36 AM
mungustas
# Postfix wrap em up
10:36 AM
PF %{POSTFIX} (?:%{POSTFIXSMTP}|%{POSTFIXANVIL}|%{POSTFIXQMGR}|%{POSTFIXBOUNCE}|%{POSTFIXCLEANUP}|%{POSTFIXSMTPD}|%{POSTFIXREWRITE})
10:37 AM
it’s like matching it all in one place or something ?
10:37 AM
bjorn_
The | matches any of the given pattern into the "PF" field
10:41 AM
michel_ joined the channel
10:42 AM
mungustas
so I guess I could do something like match the beggining like timestamp etc and then use “PF” to match everything else postfix related
10:42 AM
nemish joined the channel
10:42 AM
bjorn_
That's probably what that pattern file allows. I didn't read it.
10:42 AM
michel_
Hi, when executing the config-check: /opt/logstash/bin/logstash --configtest , i'm running into an error
10:43 AM
when executing the config check file by file, it's ok..
10:43 AM
bjorn_
It probably helps if you show the error message.
10:43 AM
michel_
The error reported is: undefined method `+' for nil:NilClass
10:44 AM
bjorn_
Mhm
10:45 AM
michel_
strange, right?
10:46 AM
Xylakant
michel_: i'd combine all individual configs to a single file and run configtest on that
10:46 AM
bjorn_
Logstash will merge all the conf.d files, probably resulting in something that's not seen when you check one by one.
10:46 AM
Exactly
10:46 AM
cat * > /tmp/newconfig
10:50 AM
michel_
ok, thanks. I'm going to look into this a bit more and post you my results!!
10:57 AM
pc__ joined the channel
10:57 AM
arnonhongklay has quit
10:58 AM
arnonhongklay joined the channel
10:58 AM
Schwarzbaer joined the channel
11:00 AM
hugh_jass has quit
11:00 AM
hugh_jass joined the channel
11:01 AM
pc99096_ has quit
11:02 AM
# ---------------------------------------------------------------------------------------------------------------------------------------------- # FILE INFORMATION # ---------------------------------------------------------------------------------------------------------------------------------------------- # Filename : 102-input.GOL.conf # Package : Base configuration # Owner : ING OIB Tooling # # -------------------
11:02 AM
no goor result..
11:02 AM
no good result
11:02 AM
warkolm
please don't post stuff like that
11:02 AM
use gist/pastebin/etc
11:04 AM
michel_
i'm not sure if this works for me
11:05 AM
is there documentation for this usage?
11:06 AM
bjorn_
What usage?