Help on regex statement needed

New regex user.
I have this information that appears in the logs daily with a slight change to the number, I and attempting to replace it or just remove and the print.

info:

Periodic rotation on 1671347463727

credential=hxEzmjSybyBAsJq6fgagvaphokrOF9JiWkLY9ll+soRk9KZ6XF2sEr9Fxu6jCpv5uwS/6f0IcPbtdzHXlkmHdjcclN5C1HSBFN/FsaKsB5tt0emUBfL8AuT4VIoMYnbupEdcPWO0yU4=
company.uuid=0ada4180-b305-11e5-9235-90b11c05f31e

The collector size

here is the regex statement im using to find the paragraph, but i need to remove all occurences each day, or ignore them . I need a way to replace

/(?<=n).*/g

@eric.atwood

Can you show what is the input and required output

Cheers

This is information that i dont want to see in the logs, From #Periodic to the second (=) sign , or the entire portion, it can be nulled out

Periodic rotation on 1671347463727

credential=hxEzmjSybyBAsJq6fgagvaphokrOF9JiWkLY9ll+soRk9KZ6XF2sEr9Fxu6jCpv5uwS/6f0IcPbtdzHXlkmHdjcclN5C1HSBFN/FsaKsB5tt0emUBfL8AuT4VIoMYnbupEdcPWO0yU4=
company.uuid=0ada4180-b305-11e5-9235-90b11c05f31e

The collector size

@eric.atwood

If you want only the above string you can use the below regex

System.text.regularexpressions.regex.match("yourstring","(?=company\.uuid).*").Value

Cheers

No , I do want everything else in the logs but not this. that paragraph triggers an alert. So maybe asking to omit it from the output.

@eric.atwood

Please can you be clear…i am not able to understand what is needed…

Cheers

what im saying is i want to omit this information from the logs before printed , everything else I want to leave at ii is

Periodic rotation on 1671347463727

credential=hxEzmjSybyBAsJq6fgagvaphokrOF9JiWkLY9ll+soRk9KZ6XF2sEr9Fxu6jCpv5uwS/6f0IcPbtdzHXlkmHdjcclN5C1HSBFN/FsaKsB5tt0emUBfL8AuT4VIoMYnbupEdcPWO0yU4=
company.uuid=0ada4180-b305-11e5-9235-90b11c05f31e

The collector size

@eric.atwood

What is the complete data? Can you show that…then it would be easy

cheers

product.code={B8BE4241-B235-4DA2-8642-CF9627F8303E}

Installer version, Shall not be modified

installer.version=0001

Generated by Agent Configuration Wizard

server=roundtowersandbox.logicmonitor.com
company=roundtowersandbox
id=51

Periodic rotation on 1671655173725

credential=Em/V9qZZnVXQu/+3BV96NxSGWaabdIZQL36Kj4U3AicKJSChj1w9gCFXASMlPgly5b6KXRSMQ15bANqkyeVmITaY8hRd+gpEefMhxe2ubX5TnrbiiLIirO2GQB3WmpIeAAy5THqp/ug=

The collector size

collector.size=Small

collector.auto.restart.enable=true
collector.auto.restart.min.interval.in.minutes=60

feed.version.check.intervalInSec=5

logger settings. Set logger.size to 0 to no limitation on logger size, otherwise, size limited to Mbytes specified by that

logger.output=console
logger.logfile=
logger.size=64
logger.level=info

watchdog log level

logger.watchdog=info

for each component, add more detailed control here

e.g.

logger.level.controller=debug

if not set, it will use default log level, i.e. value of logger.level

if agent shall watch watchdog, default to false

agentmonitorwatchdog=true

whether watchdog upgrades agent, default to true

agent.autoupgrade=true

service connection timeouts. Default to 5 seconds for connecting and 30 seconds for sending / reading feeds from server

service.connect_timeout=5
service.read_timeout=30

verify certification by host header instead host in url, so we can set “service.trustall” to false

service.verify_cert_by_host_header=false

SSL & Proxy settings

ssl.enable=true
proxy.enable=false
proxy.host=
proxy.port=
proxy.user=
proxy.pass=
proxy.exclude=
proxy.global=false

sbproxy settings

sbproxy.address=127.0.0.1
sbproxy.port=7211
sbproxy.logsize=64
sbproxy.restartOn102=false
sbproxy.pdhNoAuthentication=false

watchdog monitor the sbproxy option, default is true

sbproxy.monitor.enable=true

sbproxy connection pool settings

sbproxy.pool.connections=50
sbproxy.pool.maxlifetime=1800

sbproxy request recording settings

sbproxy.recordrequest=false
sbproxy.recordsize=64

linux proxy specific settings, timeout in seconds

sbproxy.linux.timeout=30
sbproxy.linux.threadPoolSize=120

reporters

number of threads to be used for reporting task feeds

reporter.task.concurrency=10
reporter.task.queue=10000
reporter.task.dropratio=0.5

buffer reporter speed

reporter.persistent.queue.consumer=10
reporter.persistent.queue.consume.rate=10

agent restart cycle, in hours

agent.restart=0

agent & watchdog status listener settings

agent.status.port=7212
agent.keep.alive.check.times=2
watchdog.status.port=7213
watchdog.keep.alive.timeout.in.second=60
watchdog.keep.alive.check.times=2
watchdog.restart.blocked.collector.enable=true
watchdog.check.scheduled.task.enable=false
watchdog.wait.agent.start.time.inseconds=45
watchdog.check.agent.cant.start.interval.time.in.second=240
watchdog.stop.then.start.agent.interval.seconds=5

remote session

remotesession.disable=false

we will force check the proxy ssl certificates when using proxy

remotesession.useproxy.forceSSLCheck=true

when the proxy.enable is true, did the remote session also connect through local proxy on collector. has no effect when proxy.enable is false

remotesession.proxy.enable=true

utility settings, cache time in seconds

wmi.bad.cache=600
pdh.bad.cache=600

added openmetrics in collection define

collector.defines=ping,script,snmp,webpage,jdbc,perfmon,wmi,netapp,jmx,datapump,memcached,dns,esx,xen,udp,tcp,mongo,cim,awscloudwatch,awsdynamodb,awsbilling,awss3,awssqs,batchscript,sdkscript,openmetrics,syntheticsselenium
collector.convertLocaleEnglish.enable=false

collector conf, format

each collector configuration enry has following formmat

collector..=value

currently, following parameter defined for each collector

enable - if the collector is enabled or not, value shall be true or false

threadpool - # of threads in the pool

timeout - timeout value for handling a task

concurrency - concurrency value for a collector. Collectors like snmp and ping may handle tasks co-corrently

hostconcurrency - concurrency host # allowed, default to 0

configure - collector specific configure, value shall be comma-seperated values, and will be handled by

corresponding collector handler

mongo collector configuration

collector.mongo.enable=true
collector.mongo.threadpool=1
collector.mongo.timeout=30

dns collector configuration

collector.dns.enable=true
collector.dns.threadpool=1
collector.dns.timeout=1

ping collector configuration

collector.ping.enable=true
collector.ping.threadpool=5

set the default value is 50 to avoid the ICMP ping timeout

collector.ping.timeout=50
collector.ping.request.timeout.delta=2
collector.ping.asynchronous=true

snmp collector configuration

collector.snmp.enable=true
collector.snmp.threadpool=50

script collector configuration

collector.script.enable=true
collector.script.threadpool=100
collector.script.timeout=120

sdkscript collector configuration

collector.sdkscript.enable=true
collector.sdkscript.threadpool=10
collector.sdkscript.timeout=120

batchscript collector configuration

collector.batchscript.enable=true

Batchscript Threadpool Size

collector.batchscript.threadpool=20
collector.batchscript.timeout=120

jdbc collector configuration

collector.jdbc.enable=true
collector.jdbc.threadpool=50
collector.jdbc.timeout=10

webpage collector configuration

collector.webpage.enable=true
collector.webpage.threadpool=10
collector.webpage.timeout=30

perfmon collector configuration

collector.perfmon.enable=true
collector.perfmon.threadpool=5
collector.perfmon.timeout=120

pdh collecotr less fsm timeout delta

collector.perfmon.request.timeout.delta=3

WMI collector configuration

collector.wmi.enable=true
collector.wmi.threadpool=5
collector.wmi.timeout=120

wmi collecotr less fsm timeout delta

collector.wmi.request.timeout.delta=3
collector.wmi.property.trim.enable=false

NetApp collector configuration

collector.netapp.enable=true
collector.netapp.threadpool=5
collector.netapp.timeout=15

MemCached collector configuration

collector.memcached.enable=true
collector.memcached.threadpool=1
collector.memcached.timeout=30

JMX collector configuration

collector.jmx.enable=true
collector.jmx.threadpool=200
collector.jmx.timeout=5
collector.jmx.read.timeout.in.seconds=30
collector.jmx.cache.connection.state.enable=true
collector.jmx.connection.check.period.in.millisecond=0
collector.jmx.cache.connection=true
collector.jmx.cache.connection.max=100
collector.jmx.cache.connection.url.max=10000
collector.jmx.cache.connection.wait.timeout.in.second=5
collector.jmx.batch.enable=true
collector.jmx.retry.interval.min.in.second=5
collector.jmx.retry.interval.max.in.second=120

DataPumpCollector configuration

collector.datapump.enable=true
collector.datapump.threadpool=1
collector.datapump.timeout=5

ESXCollector configuration

collector.esx.enable=true
collector.esx.threadpool=50
collector.esx.timeout=30
collector.esx.report.connectFailure.times=3

XenCollector configuration

collector.xen.enable=true
collector.xen.threadpool=20
collector.xen.timeout=600

UDP

collector.udp.enable=true
collector.udp.threadpool=5
collector.udp.timeout=60

TCP

collector.tcp.enable=true
collector.tcp.threadpool=5
collector.tcp.timeout=60

CIM collector configuration

collector.cim.enable=true
collector.cim.threadpool=20
collector.cim.timeout=30

collector heartbeat

collector.heartbeat.hang.stacktrace=true

config source monitoring

configcollector.defines=script
configcollector.postprocess.threadpool=10
configcollector.postprocess.timeout.in.seconds=60

configcollector.script.enable=true
configcollector.script.threadpool=30
configcollector.script.timeout=300

eventcollector

eventcollector.defines=echo,wineventlog,snmptrap,syslog,logfile,scriptevent,httpevent

Echo

eventcollector.echo.enable=true
eventcollector.echo.threadpool=10
eventcollector.echo.timeout=50

Windows Event Logging

eventcollector.wineventlog.enable=true
eventcollector.wineventlog.threadpool=10
eventcollector.wineventlog.timeout=60
eventcollector.wineventlog.interval=120
eventcollector.wineventlog.max.eventitem=500
eventcollector.wineventlog.criticalmappings=Critical,Critique,Kritisch,Critico
eventcollector.wineventlog.enable.single.mode.timeout.count=5
eventcollector.wineventlog.timeout.enable.single.mode=true

eventcollector.httpevent.enable=true
eventcollector.httpevent.threadpool=10

SnmpTrap

eventcollector.snmptrap.enable=true
eventcollector.snmptrap.threadpool=10
eventcollector.snmptrap.address=udp:0.0.0.0/162

this is for v2c and v1 trap

eventcollector.snmptrap.community=

following configures are for v3 especially

community string

eventcollector.snmptrap.security=public

set authentication protocol (MD5|SHA)

eventcollector.snmptrap.auth=sha

set authentication protocol pass phrase

eventcollector.snmptrap.auth.token=PleaseModifyThis

set privacy protocol (des|aes|3des|aes128|aes192|aes256)

eventcollector.snmptrap.priv=aes128

set privacy protocol pass phrase

eventcollector.snmptrap.priv.token=PleaseModifyThis

syslog

eventcollector.syslog.enable=true
eventcollector.syslog.threadpool=10

You can disable customized date format by remove all below confs start with - eventcollector.syslog.supportDateFormat

will be used as the DateTimeFormatter

the default for structured event in syslog4j

eventcollector.syslog.supportDateFormat.1=MMM dd HH:mm:ss

the default for non structured event in syslog4j

eventcollector.syslog.supportDateFormat.2=yyyy-MM-dd’T’HH:mm:ss.SSS
eventcollector.syslog.supportDateFormat.3=MMM dd HH:mm:ss.SSS z:
eventcollector.syslog.supportDateFormat.4='date=‘yyyy-MM-dd’,time=‘HH:mm:ss
eventcollector.syslog.supportDateFormat.5=MMM dd yyyy HH:mm:ss
eventcollector.syslog.supportDateFormat.6=yyyy-MM-dd’T’HH:mm:ss.SSSXXX
eventcollector.syslog.supportDateFormat.7=yyyy-MM-dd’T’HH:mm:ss.SSSSSS’Z’

Thats only a portion of the log

@eric.atwood

Please use like this to replace that part

System.Text.RegularExpressions.Regex.Replace(str,"(?=Periodic rotation on)(.|\s)*(?<=The collector size)","")

This will replaced the highlighted part leaving out the remaining

Str is where you have your while string

Input:
image

Output:
image

cheers

Thanks , let me check , but im seeing zero matches

Sorry that didnt work

@eric.atwood

Didn’t it replace the non required string?

Can I see what you did?

cheers

(?=Peroidic rotation on)(.|\s)*(?<=The collector size)

@eric.atwood

You are either giving something weong or the data is case sensitive…we can make case insensitive as well…

System.Text.RegularExpressions.Regex.Replace(str,“(?=Periodic rotation on)(.|\s)*(?<=The collector size)”,“”,RegexOptions.IgnoreCase)

Cheers


still not finding a match
same data

@eric.atwood

If you are rrying there then…select c# on left and you have to give only this

(?=Periodic rotation on)(.|\s)*(?<=The collector size)

As I gave in screenshot…and here if you want case insensitive…click on the gm beside regular expression and select case insenstive

Cheers

Thanks for your help, but still not luck in regex101

Have a log file that i am trying to remove this text below from output and print the rest.

Periodic rotation on 1671347463727

credential=hxEzmjSybyBAsJq6fgagvaphokrOF9JiWkLY9ll+soRk9KZ6XF2sEr9Fxu6jCpv5uwS/6f0IcPbtdzHXlkmHdjcclN5C1HSBFN/FsaKsB5tt0emUBfL8AuT4VIoMYnbupEdcPWO0yU4=
company.uuid=0ada4180-b305-11e5-9235-90b11c05f31e

The collector size

The rotation number is subject to change