Skip to content

Instantly share code, notes, and snippets.

View Gregcake's full-sized avatar
💭
Hacking into the mainframe

Greg Tan Gregcake

💭
Hacking into the mainframe
  • TradeGecko
  • Singapore
View GitHub Profile
@Gregcake
Gregcake / logs.md
Last active October 30, 2023 08:59
Types of logs

Single line logs

2021-07-08 13:41:04 - o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext

JSON logs

{
+ exec
+ source /vault/secrets/misool-catalog
+ exec java -server '-Duser.timezone=Asia/Bangkok' -Dcom.sun.management.jmxremote '-Dcom.sun.management.jmxremote.authenticate=false' '-Dcom.sun.management.jmxremote.ssl=false' '-Dsun.net.inetaddr.ttl=30' -XX:+UseG1GC -Xmn1400m -Xms1800m -Xmx2800m -Xss256k -XX:+UseCompressedOops -XX:+DisableExplicitGC -XX:+UseTLAB '-XX:MetaspaceSize=128m' '-XX:MaxMetaspaceSize=128m' -XX:+AggressiveOpts -XX:+PrintGCDateStamps -XX:+StartAttachListener -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation '-XX:NumberOfGCLogFiles=5' '-XX:GCLogFileSize=128M' -Xloggc:log/gc/gc.log -javaagent:/etc/service/datadog/dd-java-agent.jar -cp /usr/lib/jvm/java-1.8-openjdk/lib/tools.jar:bin/misool-catalog.jar com.halodoc.misool.catalog.CatalogApplication server config/misool-catalog-stage.yml
OpenJDK 64-Bit Server VM warning: Cannot open file log/gc/gc.log due to No such file or directory
[dd.trace 2021-03-26 17:27:13:971 +0700] [main] DEBUG datadog.trace.api.Config - New instance: Config(apiKey
Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.lang.IllegalAccessError: tried to access field net.bytebuddy.dynamic.Nexus.NO_QUEUE from class net.bytebuddy.dynamic.NexusAccessor
at net.bytebuddy.dynamic.NexusAccessor.<init>(NexusAccessor.java:53)
at net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$SelfInjection$Split.<init>(AgentBuilder.java:2964)
instances: [{}]
#!/usr/bin/env python
# Copyright 2019 Sophos Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
# compliance with the License.
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
from datadog_checks.base import AgentCheck
from datadog_checks.base.utils.subprocess_output import get_subprocess_output
__version__ = "1.0.0"
class SophosCheck(AgentCheck):
def check(self, instance):
stdout, stderr, status_code = get_subprocess_output(["python", <ABSOLUTE PATH FOR siem.py>, "-c", <ABSOLUTE PATH FOR config.ini>], self.log, raise_on_empty_output=False)
self.gauge('sophos.siem.run', status_code)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1070010001
2040230200
2040230175
3010020014
3010020027
1010010024
2010010059
2010010024
2040030014
2040040005
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 7 columns, instead of 4 in line 7.
Product ID,Variant ID,Product Name (Required),SKU (Required),Variant Name (Required),Woocommerce,Woocommerce Sale [AUD]
19749337,32562353,Brewista Artisan Gooseneck Variable Kettle,BA6VKSAACG,Brewista Artisan Gooseneck Variable Kettle - Pre-Order/BV382606VCNCG,TRUE,179.0
19749337,32562354,Brewista Artisan Gooseneck Variable Kettle,BAVTK2WAU,Brewista Artisan Gooseneck Variable Kettle - Pre-Order/BV382606VCNCG/BV382606VCPW,TRUE,209.0
19749337,32562355,Brewista Artisan Gooseneck Variable Kettle,BA6VKSAAS,Brewista Artisan Gooseneck Variable Kettle - Pre-Order/BV382606VCNCG/BV382606VCPW/BV382606VCNW,TRUE,179.0
19749337,44379063,Brewista Artisan Gooseneck Variable Kettle,BA6VKSAACD,Brewista Artisan Gooseneck Variable Kettle/BA6VKSAACD,TRUE,189.0
19749337,44379064,Brewista Artisan Gooseneck Variable Kettle,BAVTK2BAU,Brewista Artisan Gooseneck Variable Kettle/BA6VKSAAMB,TRUE,209.0
19749338,32562356,Flair Espresso Maker,FLAIR-BUNDLE,Flair Espresso Maker/FLAIR-BUNDLE,TRUE,289.0
19749338,32562357,Flair Espresso Maker,FL
56319845 30133194
52945379 29369110
52945383 29369114
52945385 29369114
52945386 29369114
52945384 29369114
52945337 29369099
52945335 29369099
52945336 29369099
52945333 29369099