├── .clang-format ├── .clang-tidy ├── .clangd ├── .devcontainer ├── Dockerfile ├── devcontainer.json ├── devcontainer.json.lldb └── gen_env.sh ├── .dockerignore ├── .gitbook.yaml ├── .github ├── ISSUE_TEMPLATE │ ├── ask-a-question.md │ ├── awesome-ilogtail.md │ ├── bug-report.md │ ├── config.yml │ ├── doc.md │ ├── enhancement.md │ └── feature-request.md └── workflows │ ├── benchmark.yaml │ ├── build-core-ut.yaml │ ├── build-core.yaml │ ├── build-pure-plugin.yaml │ ├── build.yaml │ ├── e2e-framework.yaml │ ├── e2e.yaml │ └── static-check.yaml ├── .gitignore ├── .gitmodules ├── .golangci.yml ├── .markdownlint.json ├── .vscode └── launch.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Makefile ├── README.md ├── changes ├── v1.0.27.md ├── v1.0.28.md ├── v1.0.29.md ├── v1.0.30.md ├── v1.0.31.md ├── v1.0.32.md ├── v1.0.33.md ├── v1.0.34.md ├── v1.1.0.md ├── v1.1.1.md ├── v1.2.1.md ├── v1.3.0.md ├── v1.3.1.md ├── v1.4.0.md ├── v1.5.0.md ├── v1.6.0.md ├── v1.7.0.md ├── v1.7.1.md ├── v1.8.0.md ├── v1.8.1.md ├── v1.8.3.md ├── v1.8.4.md └── v2.0.0.md ├── config_server ├── README.md └── protocol │ ├── README.md │ ├── v1 │ ├── agent.proto │ └── user.proto │ └── v2 │ ├── README.md │ └── agentV2.proto ├── core ├── CMakeLists.txt ├── app_config │ ├── AppConfig.cpp │ └── AppConfig.h ├── application │ ├── Application.cpp │ └── Application.h ├── checkpoint │ ├── AdhocCheckpointManager.cpp │ ├── AdhocCheckpointManager.h │ ├── AdhocFileCheckpoint.cpp │ ├── AdhocFileCheckpoint.h │ ├── AdhocJobCheckpoint.cpp │ ├── AdhocJobCheckpoint.h │ ├── CheckPointManager.cpp │ ├── CheckPointManager.h │ ├── CheckpointManagerV2.cpp │ ├── CheckpointManagerV2.h │ ├── RangeCheckpoint.cpp │ └── RangeCheckpoint.h ├── collection_pipeline │ ├── CollectionPipeline.cpp │ ├── CollectionPipeline.h │ ├── CollectionPipelineContext.cpp │ ├── CollectionPipelineContext.h │ ├── CollectionPipelineManager.cpp │ ├── CollectionPipelineManager.h │ ├── GlobalConfig.cpp │ ├── GlobalConfig.h │ ├── batch │ │ ├── BatchItem.h │ │ ├── BatchStatus.h │ │ ├── BatchedEvents.cpp │ │ ├── BatchedEvents.h │ │ ├── Batcher.h │ │ ├── FlushStrategy.cpp │ │ ├── FlushStrategy.h │ │ ├── TimeoutFlushManager.cpp │ │ └── TimeoutFlushManager.h │ ├── limiter │ │ ├── ConcurrencyLimiter.cpp │ │ ├── ConcurrencyLimiter.h │ │ ├── RateLimiter.cpp │ │ └── RateLimiter.h │ ├── plugin │ │ ├── PluginRegistry.cpp │ │ ├── PluginRegistry.h │ │ ├── creator │ │ │ ├── CProcessor.h │ │ │ ├── DynamicCProcessorCreator.cpp │ │ │ ├── DynamicCProcessorCreator.h │ │ │ ├── PluginCreator.h │ │ │ ├── StaticFlusherCreator.h │ │ │ ├── StaticInputCreator.h │ │ │ └── StaticProcessorCreator.h │ │ ├── instance │ │ │ ├── FlusherInstance.cpp │ │ │ ├── FlusherInstance.h │ │ │ ├── InputInstance.cpp │ │ │ ├── InputInstance.h │ │ │ ├── PluginInstance.h │ │ │ ├── ProcessorInstance.cpp │ │ │ └── ProcessorInstance.h │ │ └── interface │ │ │ ├── Flusher.cpp │ │ │ ├── Flusher.h │ │ │ ├── HttpFlusher.h │ │ │ ├── Input.h │ │ │ ├── Plugin.h │ │ │ ├── Processor.cpp │ │ │ └── Processor.h │ ├── queue │ │ ├── BoundedProcessQueue.cpp │ │ ├── BoundedProcessQueue.h │ │ ├── BoundedQueueInterface.h │ │ ├── BoundedSenderQueueInterface.cpp │ │ ├── BoundedSenderQueueInterface.h │ │ ├── CircularProcessQueue.cpp │ │ ├── CircularProcessQueue.h │ │ ├── ExactlyOnceQueueManager.cpp │ │ ├── ExactlyOnceQueueManager.h │ │ ├── ExactlyOnceSenderQueue.cpp │ │ ├── ExactlyOnceSenderQueue.h │ │ ├── ProcessQueueInterface.cpp │ │ ├── ProcessQueueInterface.h │ │ ├── ProcessQueueItem.h │ │ ├── ProcessQueueManager.cpp │ │ ├── ProcessQueueManager.h │ │ ├── QueueInterface.h │ │ ├── QueueKey.h │ │ ├── QueueKeyManager.cpp │ │ ├── QueueKeyManager.h │ │ ├── QueueParam.h │ │ ├── SLSSenderQueueItem.h │ │ ├── SenderQueue.cpp │ │ ├── SenderQueue.h │ │ ├── SenderQueueItem.h │ │ ├── SenderQueueManager.cpp │ │ └── SenderQueueManager.h │ ├── route │ │ ├── Condition.cpp │ │ ├── Condition.h │ │ ├── Router.cpp │ │ └── Router.h │ └── serializer │ │ ├── JsonSerializer.cpp │ │ ├── JsonSerializer.h │ │ ├── SLSSerializer.cpp │ │ ├── SLSSerializer.h │ │ └── Serializer.h ├── common │ ├── BoostRegexValidator.cpp │ ├── CMakeLists.txt │ ├── CircularBuffer.h │ ├── CompressTools.cpp │ ├── CompressTools.h │ ├── CrashBackTraceUtil.cpp │ ├── CrashBackTraceUtil.h │ ├── DNSCache.cpp │ ├── DNSCache.h │ ├── DevInode.cpp │ ├── DevInode.h │ ├── DynamicLibHelper.cpp │ ├── DynamicLibHelper.h │ ├── EncodingConverter.cpp │ ├── EncodingConverter.h │ ├── EncodingUtil.cpp │ ├── EncodingUtil.h │ ├── EndpointUtil.cpp │ ├── EndpointUtil.h │ ├── EnvUtil.cpp │ ├── EnvUtil.h │ ├── ErrorUtil.h │ ├── ExceptionBase.h │ ├── FeedbackInterface.h │ ├── FileEncryption.cpp │ ├── FileEncryption.h │ ├── FileInfo.h │ ├── FileSystemUtil.cpp │ ├── FileSystemUtil.h │ ├── Flags.h │ ├── GetUUID.cpp │ ├── HashUtil.cpp │ ├── HashUtil.h │ ├── JsonUtil.cpp │ ├── JsonUtil.h │ ├── LRUCache.h │ ├── Lock.h │ ├── LogFileOperator.cpp │ ├── LogFileOperator.h │ ├── LogRunnable.h │ ├── LogtailCommonFlags.cpp │ ├── LogtailCommonFlags.h │ ├── MachineInfoUtil.cpp │ ├── MachineInfoUtil.h │ ├── MemoryBarrier.h │ ├── NetworkUtil.cpp │ ├── NetworkUtil.h │ ├── ParamExtractor.cpp │ ├── ParamExtractor.h │ ├── ProcParser.cpp │ ├── ProcParser.h │ ├── RandomUtil.cpp │ ├── RandomUtil.h │ ├── RuntimeUtil.cpp │ ├── RuntimeUtil.h │ ├── SafeQueue.h │ ├── ScopeInvoker.h │ ├── Semaphore.h │ ├── SlidingWindowCounter.h │ ├── Span.h │ ├── SplitedFilePath.cpp │ ├── SplitedFilePath.h │ ├── StringTools.cpp │ ├── StringTools.h │ ├── StringView.h │ ├── Strptime.cpp │ ├── Strptime.h │ ├── Thread.h │ ├── ThreadPool.h │ ├── TimeKeeper.cpp │ ├── TimeKeeper.h │ ├── TimeUtil.cpp │ ├── TimeUtil.h │ ├── UUIDUtil.cpp │ ├── UUIDUtil.h │ ├── Version.cpp.in │ ├── WaitObject.h │ ├── YamlUtil.cpp │ ├── YamlUtil.h │ ├── common.cmake │ ├── compression │ │ ├── CompressType.h │ │ ├── Compressor.cpp │ │ ├── Compressor.h │ │ ├── CompressorFactory.cpp │ │ ├── CompressorFactory.h │ │ ├── LZ4Compressor.cpp │ │ ├── LZ4Compressor.h │ │ ├── ZstdCompressor.cpp │ │ └── ZstdCompressor.h │ ├── http │ │ ├── AsynCurlRunner.cpp │ │ ├── AsynCurlRunner.h │ │ ├── Constant.cpp │ │ ├── Constant.h │ │ ├── Curl.cpp │ │ ├── Curl.h │ │ ├── HttpRequest.cpp │ │ ├── HttpRequest.h │ │ ├── HttpResponse.cpp │ │ └── HttpResponse.h │ ├── links.cmake │ ├── magic_enum.hpp │ ├── memory │ │ └── SourceBuffer.h │ ├── murmurhash3.cpp │ ├── murmurhash3.h │ ├── queue │ │ ├── blockingconcurrentqueue.h │ │ ├── concurrentqueue.h │ │ └── lightweightsemaphore.h │ ├── timer │ │ ├── HttpRequestTimerEvent.cpp │ │ ├── HttpRequestTimerEvent.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── TimerEvent.h │ ├── version.h │ └── xxhash │ │ ├── xxh3.h │ │ ├── xxh_x86dispatch.c │ │ ├── xxh_x86dispatch.h │ │ ├── xxhash.c │ │ └── xxhash.h ├── config │ ├── CollectionConfig.cpp │ ├── CollectionConfig.h │ ├── ConfigDiff.h │ ├── ConfigUtil.cpp │ ├── ConfigUtil.h │ ├── InstanceConfig.h │ ├── InstanceConfigManager.cpp │ ├── InstanceConfigManager.h │ ├── TaskConfig.cpp │ ├── TaskConfig.h │ ├── common_provider │ │ ├── CommonConfigProvider.cpp │ │ ├── CommonConfigProvider.h │ │ ├── LegacyCommonConfigProvider.cpp │ │ └── LegacyCommonConfigProvider.h │ ├── feedbacker │ │ ├── ConfigFeedbackReceiver.cpp │ │ ├── ConfigFeedbackReceiver.h │ │ ├── ConfigFeedbackable.cpp │ │ └── ConfigFeedbackable.h │ ├── provider │ │ ├── ConfigProvider.cpp │ │ └── ConfigProvider.h │ └── watcher │ │ ├── ConfigWatcher.cpp │ │ ├── ConfigWatcher.h │ │ ├── InstanceConfigWatcher.cpp │ │ ├── InstanceConfigWatcher.h │ │ ├── PipelineConfigWatcher.cpp │ │ └── PipelineConfigWatcher.h ├── constants │ ├── Constants.cpp │ ├── Constants.h │ ├── EntityConstants.cpp │ ├── EntityConstants.h │ ├── SpanConstants.cpp │ ├── SpanConstants.h │ ├── TagConstants.cpp │ └── TagConstants.h ├── container_manager │ ├── ConfigContainerInfoUpdateCmd.h │ ├── ContainerDiscoveryOptions.cpp │ └── ContainerDiscoveryOptions.h ├── dependencies.cmake ├── ebpf │ ├── Config.cpp │ ├── Config.h │ ├── EBPFAdapter.cpp │ ├── EBPFAdapter.h │ ├── EBPFServer.cpp │ ├── EBPFServer.h │ ├── driver │ │ ├── BPFMapTraits.h │ │ ├── BPFWrapper.h │ │ ├── CMakeLists.txt │ │ ├── CallName.h │ │ ├── IdAllocator.h │ │ ├── Log.cpp │ │ ├── Log.h │ │ ├── NetworkFilter.cpp │ │ ├── NetworkFilter.h │ │ ├── eBPFDriver.cpp │ │ └── eBPFDriver.h │ ├── include │ │ └── export.h │ ├── plugin │ │ ├── AbstractManager.cpp │ │ ├── AbstractManager.h │ │ ├── ProcessCache.cpp │ │ ├── ProcessCache.h │ │ ├── ProcessCacheManager.cpp │ │ ├── ProcessCacheManager.h │ │ ├── ProcessCacheValue.cpp │ │ ├── ProcessCacheValue.h │ │ ├── ProcessCleanupRetryableEvent.cpp │ │ ├── ProcessCleanupRetryableEvent.h │ │ ├── ProcessCloneRetryableEvent.cpp │ │ ├── ProcessCloneRetryableEvent.h │ │ ├── ProcessDataMap.cpp │ │ ├── ProcessDataMap.h │ │ ├── ProcessExecveRetryableEvent.cpp │ │ ├── ProcessExecveRetryableEvent.h │ │ ├── ProcessExitRetryableEvent.cpp │ │ ├── ProcessExitRetryableEvent.h │ │ ├── ProcessSyncRetryableEvent.cpp │ │ ├── ProcessSyncRetryableEvent.h │ │ ├── RetryableEvent.h │ │ ├── RetryableEventCache.cpp │ │ ├── RetryableEventCache.h │ │ ├── network_observer │ │ │ ├── Connection.cpp │ │ │ ├── Connection.h │ │ │ ├── ConnectionManager.cpp │ │ │ ├── ConnectionManager.h │ │ │ ├── NetworkObserverManager.cpp │ │ │ ├── NetworkObserverManager.h │ │ │ └── Type.h │ │ ├── network_security │ │ │ ├── NetworkSecurityManager.cpp │ │ │ └── NetworkSecurityManager.h │ │ └── process_security │ │ │ ├── ProcessSecurityManager.cpp │ │ │ └── ProcessSecurityManager.h │ ├── protocol │ │ ├── AbstractParser.h │ │ ├── ParserRegistry.h │ │ ├── ProtocolParser.cpp │ │ ├── ProtocolParser.h │ │ └── http │ │ │ ├── HttpParser.cpp │ │ │ ├── HttpParser.h │ │ │ ├── picohttpparser.cpp │ │ │ └── picohttpparser.h │ ├── type │ │ ├── AggregateEvent.cpp │ │ ├── AggregateEvent.h │ │ ├── CommonDataEvent.h │ │ ├── FileEvent.h │ │ ├── NetworkEvent.h │ │ ├── NetworkObserverEvent.h │ │ ├── ProcessEvent.h │ │ └── table │ │ │ ├── AppTable.h │ │ │ ├── BaseElements.h │ │ │ ├── DataTable.h │ │ │ ├── HttpTable.h │ │ │ ├── NetTable.h │ │ │ ├── ProcessTable.h │ │ │ ├── StaticDataRow.cpp │ │ │ └── StaticDataRow.h │ └── util │ │ ├── AggregateTree.h │ │ ├── FrequencyManager.h │ │ ├── TraceId.cpp │ │ ├── TraceId.h │ │ └── sampler │ │ ├── Sampler.cpp │ │ └── Sampler.h ├── file_server │ ├── AdhocFileManager.cpp │ ├── AdhocFileManager.h │ ├── ConfigManager.cpp │ ├── ConfigManager.h │ ├── ContainerInfo.cpp │ ├── ContainerInfo.h │ ├── EventDispatcher.cpp │ ├── EventDispatcher.h │ ├── FileDiscoveryOptions.cpp │ ├── FileDiscoveryOptions.h │ ├── FileServer.cpp │ ├── FileServer.h │ ├── FileTagOptions.cpp │ ├── FileTagOptions.h │ ├── MultilineOptions.cpp │ ├── MultilineOptions.h │ ├── event │ │ ├── BlockEventManager.cpp │ │ ├── BlockEventManager.h │ │ ├── Event.h │ │ ├── EventQueue.cpp │ │ └── EventQueue.h │ ├── event_handler │ │ ├── EventHandler.cpp │ │ ├── EventHandler.h │ │ ├── HistoryFileImporter.cpp │ │ ├── HistoryFileImporter.h │ │ ├── LogInput.cpp │ │ └── LogInput.h │ ├── event_listener │ │ ├── EventListener.h │ │ ├── EventListener_Linux.cpp │ │ ├── EventListener_Linux.h │ │ ├── EventListener_Windows.cpp │ │ └── EventListener_Windows.h │ ├── polling │ │ ├── PollingCache.cpp │ │ ├── PollingCache.h │ │ ├── PollingDirFile.cpp │ │ ├── PollingDirFile.h │ │ ├── PollingEventQueue.cpp │ │ ├── PollingEventQueue.h │ │ ├── PollingModify.cpp │ │ └── PollingModify.h │ └── reader │ │ ├── FileReaderOptions.cpp │ │ ├── FileReaderOptions.h │ │ ├── GloablFileDescriptorManager.h │ │ ├── JsonLogFileReader.cpp │ │ ├── JsonLogFileReader.h │ │ ├── LogFileReader.cpp │ │ └── LogFileReader.h ├── go_pipeline │ ├── CMakeLists.txt │ ├── LogtailPlugin.cpp │ ├── LogtailPlugin.h │ ├── LogtailPluginAdapter.cpp │ └── LogtailPluginAdapter.h ├── host_monitor │ ├── Constants.cpp │ ├── Constants.h │ ├── HostMonitorInputRunner.cpp │ ├── HostMonitorInputRunner.h │ ├── HostMonitorTimerEvent.cpp │ ├── HostMonitorTimerEvent.h │ ├── SystemInformationTools.cpp │ ├── SystemInformationTools.h │ ├── collector │ │ ├── BaseCollector.h │ │ ├── CPUCollector.cpp │ │ ├── CPUCollector.h │ │ ├── MetricCalculate.h │ │ ├── ProcessEntityCollector.cpp │ │ └── ProcessEntityCollector.h │ └── common │ │ └── FieldEntry.h ├── links.cmake ├── logger │ ├── Logger.cpp │ └── Logger.h ├── logtail.cpp ├── logtail_windows.cpp ├── metadata │ ├── ContainerInfo.h │ ├── ContainerMetadata.cpp │ ├── ContainerMetadata.h │ ├── K8sMetadata.cpp │ └── K8sMetadata.h ├── models │ ├── EventPool.cpp │ ├── EventPool.h │ ├── LogEvent.cpp │ ├── LogEvent.h │ ├── MetricEvent.cpp │ ├── MetricEvent.h │ ├── MetricValue.cpp │ ├── MetricValue.h │ ├── PipelineEvent.cpp │ ├── PipelineEvent.h │ ├── PipelineEventGroup.cpp │ ├── PipelineEventGroup.h │ ├── PipelineEventPtr.h │ ├── RawEvent.cpp │ ├── RawEvent.h │ ├── SizedContainer.h │ ├── SpanEvent.cpp │ └── SpanEvent.h ├── monitor │ ├── AlarmManager.cpp │ ├── AlarmManager.h │ ├── MetricManager.cpp │ ├── MetricManager.h │ ├── Monitor.cpp │ ├── Monitor.h │ ├── SelfMonitorServer.cpp │ ├── SelfMonitorServer.h │ ├── metric_constants │ │ ├── AgentMetrics.cpp │ │ ├── ComponentMetrics.cpp │ │ ├── MetricCommonConstants.cpp │ │ ├── MetricCommonConstants.h │ │ ├── MetricConstants.h │ │ ├── PipelineMetrics.cpp │ │ ├── PluginMetrics.cpp │ │ └── RunnerMetrics.cpp │ ├── metric_models │ │ ├── MetricRecord.cpp │ │ ├── MetricRecord.h │ │ ├── MetricTypes.h │ │ ├── ReentrantMetricsRecord.cpp │ │ ├── ReentrantMetricsRecord.h │ │ ├── SelfMonitorMetricEvent.cpp │ │ └── SelfMonitorMetricEvent.h │ └── profile_sender │ │ ├── ProfileSender.cpp │ │ └── ProfileSender.h ├── options.cmake ├── parser │ ├── DelimiterModeFsmParser.cpp │ └── DelimiterModeFsmParser.h ├── plugin │ ├── flusher │ │ ├── blackhole │ │ │ ├── FlusherBlackHole.cpp │ │ │ └── FlusherBlackHole.h │ │ ├── file │ │ │ ├── FlusherFile.cpp │ │ │ └── FlusherFile.h │ │ ├── flusher.cmake │ │ ├── links.cmake │ │ └── sls │ │ │ ├── DiskBufferWriter.cpp │ │ │ ├── DiskBufferWriter.h │ │ │ ├── Exception.h │ │ │ ├── FlusherSLS.cpp │ │ │ ├── FlusherSLS.h │ │ │ ├── PackIdManager.cpp │ │ │ ├── PackIdManager.h │ │ │ ├── SLSClientManager.cpp │ │ │ ├── SLSClientManager.h │ │ │ ├── SLSConstant.cpp │ │ │ ├── SLSConstant.h │ │ │ ├── SLSResponse.cpp │ │ │ ├── SLSResponse.h │ │ │ ├── SLSUtil.cpp │ │ │ ├── SLSUtil.h │ │ │ ├── SendResult.cpp │ │ │ └── SendResult.h │ ├── input │ │ ├── InputContainerStdio.cpp │ │ ├── InputContainerStdio.h │ │ ├── InputFeedbackInterfaceRegistry.cpp │ │ ├── InputFeedbackInterfaceRegistry.h │ │ ├── InputFile.cpp │ │ ├── InputFile.h │ │ ├── InputHostMeta.cpp │ │ ├── InputHostMeta.h │ │ ├── InputHostMonitor.cpp │ │ ├── InputHostMonitor.h │ │ ├── InputInternalAlarms.cpp │ │ ├── InputInternalAlarms.h │ │ ├── InputInternalMetrics.cpp │ │ ├── InputInternalMetrics.h │ │ ├── InputNetworkObserver.cpp │ │ ├── InputNetworkObserver.h │ │ ├── InputNetworkSecurity.cpp │ │ ├── InputNetworkSecurity.h │ │ ├── InputProcessSecurity.cpp │ │ ├── InputProcessSecurity.h │ │ ├── InputPrometheus.cpp │ │ ├── InputPrometheus.h │ │ ├── InputStaticFile.cpp │ │ ├── InputStaticFile.h │ │ ├── input.cmake │ │ └── links.cmake │ └── processor │ │ ├── CommonParserOptions.cpp │ │ ├── CommonParserOptions.h │ │ ├── DynamicCProcessorProxy.cpp │ │ ├── DynamicCProcessorProxy.h │ │ ├── ProcessorDesensitizeNative.cpp │ │ ├── ProcessorDesensitizeNative.h │ │ ├── ProcessorFilterNative.cpp │ │ ├── ProcessorFilterNative.h │ │ ├── ProcessorParseApsaraNative.cpp │ │ ├── ProcessorParseApsaraNative.h │ │ ├── ProcessorParseDelimiterNative.cpp │ │ ├── ProcessorParseDelimiterNative.h │ │ ├── ProcessorParseJsonNative.cpp │ │ ├── ProcessorParseJsonNative.h │ │ ├── ProcessorParseRegexNative.cpp │ │ ├── ProcessorParseRegexNative.h │ │ ├── ProcessorParseTimestampNative.cpp │ │ ├── ProcessorParseTimestampNative.h │ │ ├── ProcessorSPL.cpp │ │ ├── ProcessorSPL.h │ │ ├── inner │ │ ├── ProcessorMergeMultilineLogNative.cpp │ │ ├── ProcessorMergeMultilineLogNative.h │ │ ├── ProcessorParseContainerLogNative.cpp │ │ ├── ProcessorParseContainerLogNative.h │ │ ├── ProcessorPromParseMetricNative.cpp │ │ ├── ProcessorPromParseMetricNative.h │ │ ├── ProcessorPromRelabelMetricNative.cpp │ │ ├── ProcessorPromRelabelMetricNative.h │ │ ├── ProcessorSplitLogStringNative.cpp │ │ ├── ProcessorSplitLogStringNative.h │ │ ├── ProcessorSplitMultilineLogStringNative.cpp │ │ ├── ProcessorSplitMultilineLogStringNative.h │ │ ├── ProcessorTagNative.cpp │ │ └── ProcessorTagNative.h │ │ ├── links.cmake │ │ └── processor.cmake ├── prometheus │ ├── Constants.h │ ├── PromSelfMonitor.cpp │ ├── PromSelfMonitor.h │ ├── PrometheusInputRunner.cpp │ ├── PrometheusInputRunner.h │ ├── Utils.cpp │ ├── Utils.h │ ├── async │ │ ├── PromFuture.cpp │ │ ├── PromFuture.h │ │ ├── PromHttpRequest.cpp │ │ └── PromHttpRequest.h │ ├── component │ │ ├── StreamScraper.cpp │ │ └── StreamScraper.h │ ├── labels │ │ ├── Labels.cpp │ │ ├── Labels.h │ │ ├── Relabel.cpp │ │ ├── Relabel.h │ │ ├── TextParser.cpp │ │ └── TextParser.h │ └── schedulers │ │ ├── BaseScheduler.cpp │ │ ├── BaseScheduler.h │ │ ├── ScrapeConfig.cpp │ │ ├── ScrapeConfig.h │ │ ├── ScrapeScheduler.cpp │ │ ├── ScrapeScheduler.h │ │ ├── TargetSubscriberScheduler.cpp │ │ └── TargetSubscriberScheduler.h ├── protobuf │ ├── models │ │ ├── ProtocolConversion.cpp │ │ └── ProtocolConversion.h │ └── sls │ │ ├── LogGroupSerializer.cpp │ │ ├── LogGroupSerializer.h │ │ ├── checkpoint.proto │ │ ├── logtail_buffer_meta.proto │ │ ├── metric.proto │ │ └── sls_logs.proto ├── provider │ ├── CMakeLists.txt │ ├── Provider.cpp │ └── Provider.h ├── runner │ ├── FlusherRunner.cpp │ ├── FlusherRunner.h │ ├── InputRunner.cpp │ ├── InputRunner.h │ ├── ProcessorRunner.cpp │ ├── ProcessorRunner.h │ └── sink │ │ ├── Sink.h │ │ ├── SinkType.h │ │ └── http │ │ ├── HttpSink.cpp │ │ ├── HttpSink.h │ │ └── HttpSinkRequest.h ├── task_pipeline │ ├── Task.h │ ├── TaskPipeline.cpp │ ├── TaskPipeline.h │ ├── TaskPipelineManager.cpp │ ├── TaskPipelineManager.h │ ├── TaskRegistry.cpp │ └── TaskRegistry.h ├── unittest │ ├── CMakeLists.txt │ ├── Unittest.h │ ├── UnittestHelper.h │ ├── app_config │ │ ├── AppConfigUnittest.cpp │ │ ├── AppConfigUnittestLegal.cpp │ │ └── CMakeLists.txt │ ├── batch │ │ ├── BatchItemUnittest.cpp │ │ ├── BatchStatusUnittest.cpp │ │ ├── BatchedEventsUnittest.cpp │ │ ├── BatcherUnittest.cpp │ │ ├── CMakeLists.txt │ │ ├── FlushStrategyUnittest.cpp │ │ └── TimeoutFlushManagerUnittest.cpp │ ├── checkpoint │ │ ├── AdhocCheckpointManagerUnittest.cpp │ │ ├── CMakeLists.txt │ │ ├── CheckpointManagerUnittest.cpp │ │ └── CheckpointManagerV2Unittest.cpp │ ├── common │ │ ├── CMakeLists.txt │ │ ├── DevInodeUnittest.h │ │ ├── EncodingConverterUnittest.cpp │ │ ├── FileSystemUtilUnittest.h │ │ ├── InstanceIdentityUnittest.cpp │ │ ├── LRUBenchmark.cpp │ │ ├── LoadParameterUnittest.h │ │ ├── LockUnittest.h │ │ ├── LogFileOperatorUnittest.cpp │ │ ├── MachineInfoUtilUnittest.cpp │ │ ├── NetworkUtilUnittest.cpp │ │ ├── ProcParserUnittest.cpp │ │ ├── RandomUtilUnittest.h │ │ ├── SafeQueueUnittest.cpp │ │ ├── SimpleUtilsUnittest.cpp │ │ ├── SlidingWindowCounterUnittest.cpp │ │ ├── StringPieceUnittest.cpp │ │ ├── StringToolsUnittest.cpp │ │ ├── TimeKeeperBenchmark.cpp │ │ ├── TimeUtilUnittest.h │ │ ├── YamlUtilUnittest.cpp │ │ ├── http │ │ │ └── CurlUnittest.cpp │ │ └── timer │ │ │ ├── HttpRequestTimerEventUnittest.cpp │ │ │ └── TimerUnittest.cpp │ ├── compression │ │ ├── CMakeLists.txt │ │ ├── CompressorFactoryUnittest.cpp │ │ ├── CompressorUnittest.cpp │ │ ├── LZ4CompressorUnittest.cpp │ │ └── ZstdCompressorUnittest.cpp │ ├── config │ │ ├── CMakeLists.txt │ │ ├── CommonConfigProviderUnittest.cpp │ │ ├── ConfigContainerUnittest.cpp │ │ ├── ConfigFeedbackableUnittest.cpp │ │ ├── ConfigMatchUnittest.cpp │ │ ├── ConfigUpdateUnittest.cpp │ │ ├── ConfigUpdatorUnittest.cpp │ │ ├── ConfigWatcherUnittest.cpp │ │ ├── PipelineConfigUnittest.cpp │ │ ├── PipelineConfigWatcherUnittest.cpp │ │ ├── PipelineManagerMock.h │ │ └── TaskConfigUnittest.cpp │ ├── container_manager │ │ ├── CMakeLists.txt │ │ └── ContainerDiscoveryOptionsUnittest.cpp │ ├── controller │ │ ├── CMakeLists.txt │ │ └── EventDispatcherDirUnittest.cpp │ ├── ebpf │ │ ├── AggregatorUnittest.cpp │ │ ├── BPFMapTraitsUnittest.cpp │ │ ├── BPFWrapperUnittest.cpp │ │ ├── CMakeLists.txt │ │ ├── CommonUtilUnittest.cpp │ │ ├── ConnectionManagerUnittest.cpp │ │ ├── ConnectionUnittest.cpp │ │ ├── ConvergerUnittest.cpp │ │ ├── EBPFRawEventStub.h │ │ ├── EBPFServerUnittest.cpp │ │ ├── IdAllocatorUnittest.cpp │ │ ├── ManagerUnittest.cpp │ │ ├── NetworkObserverEventUnittest.cpp │ │ ├── NetworkObserverUnittest.cpp │ │ ├── ProcFsStub.h │ │ ├── ProcessCacheManagerUnittest.cpp │ │ ├── ProcessCacheManagerWrapper.h │ │ ├── ProcessCacheUnittest.cpp │ │ ├── ProcessCacheValueUnittest.cpp │ │ ├── ProcessCleanupRetryableEventUnittest.cpp │ │ ├── ProcessCloneRetryableEventUnittest.cpp │ │ ├── ProcessDataMapUnittest.cpp │ │ ├── ProcessExecveRetryableEventUnittest.cpp │ │ ├── ProcessExitRetryableEventUnittest.cpp │ │ ├── ProcessSyncRetryableEventUnittest.cpp │ │ ├── ProtocolParserUnittest.cpp │ │ ├── RetryableEventUnittest.cpp │ │ ├── SamplerUnittest.cpp │ │ ├── TableUnittest.cpp │ │ ├── TraceIdBenchmark.cpp │ │ ├── WorkerUnittest.cpp │ │ └── eBPFDriverUnittest.cpp │ ├── event │ │ ├── BlockedEventManagerUnittest.cpp │ │ ├── CMakeLists.txt │ │ └── EventUnittest.cpp │ ├── event_handler │ │ ├── CMakeLists.txt │ │ ├── CreateModifyHandlerUnittest.cpp │ │ ├── LogInputUnittest.cpp │ │ └── ModifyHandlerUnittest.cpp │ ├── file_source │ │ ├── CMakeLists.txt │ │ ├── FileDiscoveryOptionsUnittest.cpp │ │ ├── FileTagOptionsUnittest.cpp │ │ └── MultilineOptionsUnittest.cpp │ ├── flusher │ │ ├── CMakeLists.txt │ │ ├── FlusherSLSUnittest.cpp │ │ ├── PackIdManagerUnittest.cpp │ │ └── SLSClientManagerUnittest.cpp │ ├── host_monitor │ │ ├── CMakeLists.txt │ │ ├── CPUCollectorUnittest.cpp │ │ ├── HostMonitorInputRunnerUnittest.cpp │ │ ├── MetricCalculateUnittest.cpp │ │ ├── MockCollector.h │ │ ├── ProcessEntityCollectorUnittest.cpp │ │ └── SystemInformationToolsUnittest.cpp │ ├── input │ │ ├── CMakeLists.txt │ │ ├── InputContainerStdioUnittest.cpp │ │ ├── InputFileUnittest.cpp │ │ ├── InputHostMetaUnittest.cpp │ │ ├── InputHostMonitorUnittest.cpp │ │ ├── InputInternalAlarmsUnittest.cpp │ │ ├── InputInternalMetricsUnittest.cpp │ │ ├── InputNetworkObserverUnittest.cpp │ │ ├── InputNetworkSecurityUnittest.cpp │ │ ├── InputProcessSecurityUnittest.cpp │ │ └── InputPrometheusUnittest.cpp │ ├── instance_config │ │ ├── CMakeLists.txt │ │ └── InstanceConfigManagerUnittest.cpp │ ├── log_pb │ │ ├── CMakeLists.txt │ │ └── LogGroupSerializerUnittest.cpp │ ├── logger │ │ ├── CMakeLists.txt │ │ └── logger_unittest.cpp │ ├── loop_ut.bat │ ├── loop_ut.sh │ ├── metadata │ │ ├── CMakeLists.txt │ │ └── K8sMetadataUnittest.cpp │ ├── models │ │ ├── CMakeLists.txt │ │ ├── EventGroupBenchmark.cpp │ │ ├── EventPoolUnittest.cpp │ │ ├── LogEventUnittest.cpp │ │ ├── MetricEventUnittest.cpp │ │ ├── MetricValueUnittest.cpp │ │ ├── PipelineEventGroupUnittest.cpp │ │ ├── PipelineEventPtrUnittest.cpp │ │ ├── PipelineEventUnittest.cpp │ │ ├── RawEventUnittest.cpp │ │ ├── SizedContainerUnittest.cpp │ │ └── SpanEventUnittest.cpp │ ├── monitor │ │ ├── AlarmManagerUnittest.cpp │ │ ├── CMakeLists.txt │ │ ├── MetricManagerUnittest.cpp │ │ ├── PluginMetricManagerUnittest.cpp │ │ └── SelfMonitorMetricEventUnittest.cpp │ ├── pipeline │ │ ├── CMakeLists.txt │ │ ├── ConcurrencyLimiterUnittest.cpp │ │ ├── GlobalConfigUnittest.cpp │ │ ├── HttpSinkMock.h │ │ ├── LogtailPluginMock.h │ │ ├── PipelineManagerUnittest.cpp │ │ ├── PipelineUnittest.cpp │ │ └── PipelineUpdateUnittest.cpp │ ├── plugin │ │ ├── CMakeLists.txt │ │ ├── FlusherInstanceUnittest.cpp │ │ ├── FlusherUnittest.cpp │ │ ├── InputInstanceUnittest.cpp │ │ ├── PluginMock.h │ │ ├── PluginRegistryUnittest.cpp │ │ ├── ProcessorInstanceUnittest.cpp │ │ ├── StaticFlusherCreatorUnittest.cpp │ │ ├── StaticInputCreatorUnittest.cpp │ │ └── StaticProcessorCreatorUnittest.cpp │ ├── polling │ │ ├── CMakeLists.txt │ │ ├── PollingPreservedDirDepthUnittest.cpp │ │ └── PollingUnittest.cpp │ ├── processor │ │ ├── BoostRegexBenchmark.cpp │ │ ├── CMakeLists.txt │ │ ├── ParseContainerLogBenchmark.cpp │ │ ├── ProcessorDesensitizeNativeUnittest.cpp │ │ ├── ProcessorFilterNativeUnittest.cpp │ │ ├── ProcessorMergeMultilineLogNativeUnittest.cpp │ │ ├── ProcessorParseApsaraNativeUnittest.cpp │ │ ├── ProcessorParseContainerLogNativeUnittest.cpp │ │ ├── ProcessorParseDelimiterNativeUnittest.cpp │ │ ├── ProcessorParseJsonNativeUnittest.cpp │ │ ├── ProcessorParseRegexNativeUnittest.cpp │ │ ├── ProcessorParseTimestampNativeUnittest.cpp │ │ ├── ProcessorPromParseMetricNativeUnittest.cpp │ │ ├── ProcessorPromRelabelMetricNativeUnittest.cpp │ │ ├── ProcessorSplitLogStringNativeUnittest.cpp │ │ ├── ProcessorSplitMultilineLogStringNativeUnittest.cpp │ │ └── ProcessorTagNativeUnittest.cpp │ ├── prometheus │ │ ├── CMakeLists.txt │ │ ├── LabelsUnittest.cpp │ │ ├── PromAsynUnittest.cpp │ │ ├── PromSelfMonitorUnittest.cpp │ │ ├── PrometheusInputRunnerUnittest.cpp │ │ ├── RelabelUnittest.cpp │ │ ├── ScrapeConfigUnittest.cpp │ │ ├── ScrapeSchedulerUnittest.cpp │ │ ├── StreamScraperUnittest.cpp │ │ ├── TargetSubscriberSchedulerUnittest.cpp │ │ ├── TextParserBenchmark.cpp │ │ ├── TextParserUnittest.cpp │ │ └── UtilsUnittest.cpp │ ├── provider │ │ ├── CMakeLists.txt │ │ └── ProviderUnittest.cpp │ ├── queue │ │ ├── BoundedProcessQueueUnittest.cpp │ │ ├── CMakeLists.txt │ │ ├── CircularProcessQueueUnittest.cpp │ │ ├── ExactlyOnceQueueManagerUnittest.cpp │ │ ├── ExactlyOnceSenderQueueUnittest.cpp │ │ ├── FeedbackInterfaceMock.h │ │ ├── ProcessQueueManagerUnittest.cpp │ │ ├── QueueKeyManagerUnittest.cpp │ │ ├── QueueParamUnittest.cpp │ │ ├── SenderQueueManagerUnittest.cpp │ │ └── SenderQueueUnittest.cpp │ ├── reader │ │ ├── CMakeLists.txt │ │ ├── DeletedFileUnittest.cpp │ │ ├── FileReaderOptionsUnittest.cpp │ │ ├── FileTagUnittest.cpp │ │ ├── ForceReadUnittest.cpp │ │ ├── GetLastLineDataUnittest.cpp │ │ ├── JsonLogFileReaderUnittest.cpp │ │ ├── LogFileReaderUnittest.cpp │ │ ├── RemoveLastIncompleteLogUnittest.cpp │ │ ├── SourceBufferUnittest.cpp │ │ └── testDataSet │ │ │ ├── ForceReadUnittest │ │ │ └── utf8.txt │ │ │ ├── JsonLogFileReaderUnittest │ │ │ ├── gbk.txt │ │ │ └── utf8.txt │ │ │ └── LogFileReaderUnittest │ │ │ ├── gbk.txt │ │ │ └── utf8.txt │ ├── report_failure.sh │ ├── route │ │ ├── CMakeLists.txt │ │ ├── ConditionUnittest.cpp │ │ └── RouterUnittest.cpp │ ├── run_ut.bat │ ├── run_ut.sh │ ├── sender │ │ ├── CMakeLists.txt │ │ ├── FlusherRunnerUnittest.cpp │ │ └── SenderUnittest.cpp │ ├── serializer │ │ ├── CMakeLists.txt │ │ ├── JsonSerializerUnittest.cpp │ │ ├── SLSSerializerUnittest.cpp │ │ └── SerializerUnittest.cpp │ ├── spl │ │ ├── CMakeLists.txt │ │ ├── SplBenchmark.cpp │ │ ├── SplUnittest.cpp │ │ └── spl.txt │ └── task_pipeline │ │ ├── CMakeLists.txt │ │ ├── TaskPipelineManagerUnittest.cpp │ │ ├── TaskPipelineUnittest.cpp │ │ └── TaskRegistryUnittest.cpp └── utils.cmake ├── docker ├── Dockerfile.e2e-test ├── Dockerfile_build ├── Dockerfile_coverage ├── Dockerfile_development_part ├── Dockerfile_e2e ├── Dockerfile_edge_linux ├── Dockerfile_goc ├── Dockerfile_production ├── Dockerfile_production_minimal └── README.md ├── docs ├── cn │ ├── README.md │ ├── SUMMARY.md │ ├── about │ │ ├── benefits.md │ │ ├── brief-history.md │ │ ├── compare-editions.md │ │ └── license.md │ ├── awesome-loongcollector │ │ ├── awesome-loongcollector-getting-started.md │ │ └── awesome-loongcollector.md │ ├── benchmark │ │ └── performance-compare-with-filebeat.md │ ├── config-server │ │ ├── communication-protocol.md │ │ └── usage-instructions.md │ ├── configuration │ │ ├── collection-config.md │ │ ├── logging.md │ │ └── system-config.md │ ├── contributing │ │ ├── CONTRIBUTING.md │ │ ├── achievement.md │ │ └── developer.md │ ├── developer-guide │ │ ├── code-check │ │ │ ├── check-codestyle.md │ │ │ ├── check-dependency-license.md │ │ │ └── check-license.md │ │ ├── codestyle.md │ │ ├── data-model-cpp.md │ │ ├── data-model-golang.md │ │ ├── development-environment.md │ │ ├── log-protocol │ │ │ ├── How-to-add-new-protocol.md │ │ │ ├── converter.md │ │ │ ├── log-protocol.md │ │ │ └── protocol-spec │ │ │ │ ├── custom-single.md │ │ │ │ ├── raw.md │ │ │ │ └── sls.md │ │ ├── plugin-development │ │ │ ├── extended-plugins │ │ │ │ ├── how-to-custom-builtin-plugins.md │ │ │ │ ├── how-to-write-aggregator-plugins.md │ │ │ │ ├── how-to-write-extension-plugins.md │ │ │ │ ├── how-to-write-external-plugins.md │ │ │ │ ├── how-to-write-flusher-plugins.md │ │ │ │ ├── how-to-write-input-plugins.md │ │ │ │ ├── how-to-write-processor-plugins.md │ │ │ │ └── principles-of-plugin-configuration.md │ │ │ ├── native-plugins │ │ │ │ ├── how-to-write-native-flusher-plugins.md │ │ │ │ └── how-to-write-native-input-plugins.md │ │ │ ├── plugin-debug │ │ │ │ ├── logger-api.md │ │ │ │ ├── plugin-self-monitor-guide.md │ │ │ │ └── pure-plugin-start.md │ │ │ ├── plugin-development-guide.md │ │ │ └── plugin-docs │ │ │ │ ├── how-to-genernate-plugin-docs.md │ │ │ │ └── plugin-doc-templete.md │ │ ├── self-monitor │ │ │ ├── alarms │ │ │ │ └── internal-alarms-description.md │ │ │ └── metrics │ │ │ │ ├── how-to-add-internal-metrics.md │ │ │ │ ├── how-to-collect-internal-metrics.md │ │ │ │ └── internal-metrics-description.md │ │ └── test │ │ │ ├── How-to-add-subscriber.md │ │ │ ├── benchmark.md │ │ │ ├── e2e-test-step.md │ │ │ ├── e2e-test.md │ │ │ └── unit-test.md │ ├── events │ │ └── summer-ospp-2024 │ │ │ ├── projects │ │ │ ├── summer-ospp-2024-projects-config-server.md │ │ │ ├── summer-ospp-2024-projects-ilogtail-io.md │ │ │ └── summer-ospp-2024-projects.md │ │ │ └── summer-ospp-2024.md │ ├── installation │ │ ├── daemon.md │ │ ├── logtail-mode.md │ │ ├── loongcollector-dir.md │ │ ├── os.md │ │ ├── quick-start.md │ │ ├── release-notes │ │ │ ├── release-notes-ilogtail-1x.md │ │ │ ├── release-notes-ilogtail-2x.md │ │ │ └── release-notes.md │ │ ├── sources │ │ │ ├── build.md │ │ │ ├── dependencies.md │ │ │ ├── docker-image.md │ │ │ └── download.md │ │ ├── start-with-container.md │ │ └── start-with-k8s.md │ ├── plugins │ │ ├── aggregator │ │ │ ├── aggregator-base.md │ │ │ ├── aggregator-content-value-group.md │ │ │ ├── aggregator-context.md │ │ │ ├── aggregator-metadata-group.md │ │ │ └── aggregators.md │ │ ├── extension │ │ │ ├── ext-basicauth.md │ │ │ ├── ext-default-decoder.md │ │ │ ├── ext-default-encoder.md │ │ │ ├── ext-groupinfo-filter.md │ │ │ ├── ext-request-breaker.md │ │ │ └── extensions.md │ │ ├── flusher │ │ │ ├── extended │ │ │ │ ├── flusher-clickhouse.md │ │ │ │ ├── flusher-elasticsearch.md │ │ │ │ ├── flusher-http.md │ │ │ │ ├── flusher-kafka-v2.md │ │ │ │ ├── flusher-kafka.md │ │ │ │ ├── flusher-loki.md │ │ │ │ ├── flusher-otlp.md │ │ │ │ ├── flusher-prometheus.md │ │ │ │ ├── flusher-pulsar.md │ │ │ │ └── flusher-stdout.md │ │ │ ├── flushers.md │ │ │ └── native │ │ │ │ ├── flusher-blackhole.md │ │ │ │ ├── flusher-file.md │ │ │ │ ├── flusher-sls.md │ │ │ │ └── router.md │ │ ├── input │ │ │ ├── extended │ │ │ │ ├── input-command.md │ │ │ │ ├── metric-debug-file.md │ │ │ │ ├── metric-input-example.md │ │ │ │ ├── metric-meta-host.md │ │ │ │ ├── metric-mock.md │ │ │ │ ├── metric-system.md │ │ │ │ ├── service-canal.md │ │ │ │ ├── service-docker-stdout.md │ │ │ │ ├── service-goprofile.md │ │ │ │ ├── service-gpu.md │ │ │ │ ├── service-http-server.md │ │ │ │ ├── service-input-example.md │ │ │ │ ├── service-journal.md │ │ │ │ ├── service-kafka.md │ │ │ │ ├── service-kubernetesmeta-v2.md │ │ │ │ ├── service-mock.md │ │ │ │ ├── service-mssql.md │ │ │ │ ├── service-otlp.md │ │ │ │ ├── service-pgsql.md │ │ │ │ ├── service-snmp.md │ │ │ │ └── service-syslog.md │ │ │ ├── inputs.md │ │ │ └── native │ │ │ │ ├── input-container-stdio.md │ │ │ │ ├── input-file-security.md │ │ │ │ ├── input-file.md │ │ │ │ ├── input-host-meta.md │ │ │ │ ├── input-internal-alarms.md │ │ │ │ ├── input-internal-metrics.md │ │ │ │ ├── input-network-observer.md │ │ │ │ ├── input-network-security.md │ │ │ │ └── input-process-security.md │ │ ├── overview.md │ │ ├── processor │ │ │ ├── extended │ │ │ │ ├── README.md │ │ │ │ ├── processor-add-fields.md │ │ │ │ ├── processor-appender.md │ │ │ │ ├── processor-cloudmeta.md │ │ │ │ ├── processor-default.md │ │ │ │ ├── processor-delimiter.md │ │ │ │ ├── processor-desensitize.md │ │ │ │ ├── processor-dict-map.md │ │ │ │ ├── processor-drop.md │ │ │ │ ├── processor-encrypy.md │ │ │ │ ├── processor-fields-with-condition.md │ │ │ │ ├── processor-filter-regex.md │ │ │ │ ├── processor-gotime.md │ │ │ │ ├── processor-grok.md │ │ │ │ ├── processor-json.md │ │ │ │ ├── processor-log-to-sls-metric.md │ │ │ │ ├── processor-otel-metric.md │ │ │ │ ├── processor-otel-trace.md │ │ │ │ ├── processor-packjson.md │ │ │ │ ├── processor-rate-limit.md │ │ │ │ ├── processor-regex.md │ │ │ │ ├── processor-rename.md │ │ │ │ ├── processor-split-key-value.md │ │ │ │ ├── processor-split-log-regex.md │ │ │ │ ├── processor-string-replace.md │ │ │ │ └── processor-strptime.md │ │ │ ├── native │ │ │ │ ├── processor-desensitize-native.md │ │ │ │ ├── processor-filter-regex-native.md │ │ │ │ ├── processor-parse-delimiter-native.md │ │ │ │ ├── processor-parse-json-native.md │ │ │ │ ├── processor-parse-regex-native.md │ │ │ │ └── processor-parse-timestamp-native.md │ │ │ ├── processors.md │ │ │ └── spl │ │ │ │ └── processor-spl-native.md │ │ └── stability-level.md │ └── principle │ │ └── plugin-system.md └── en │ ├── README.md │ ├── concept&designs │ ├── Datastructure.md │ ├── Overview.md │ └── README.md │ ├── guides │ ├── How-to-build-with-docker.md │ ├── How-to-check-license.md │ ├── How-to-chek-codestyle.md │ ├── How-to-chek-dependency-license.md │ ├── How-to-do-manual-test.md │ ├── How-to-genernate-plugin-doc.md │ ├── How-to-release.md │ ├── How-to-use-logger.md │ ├── How-to-write-aggregator-plugins.md │ ├── How-to-write-flusher-plugins.md │ ├── How-to-write-input-plugins.md │ ├── How-to-write-processor-plugins.md │ ├── How-to-write-unit-test.md │ └── README.md │ ├── plugins │ ├── metric_input │ │ └── metric_input_netping.md │ ├── plugin-list.md │ ├── processor │ │ ├── processor_csv.md │ │ ├── processor_fields_with_condition.md │ │ ├── processor_gotime.md │ │ └── processor_strptime.md │ └── service_input │ │ ├── service_docker_stdout.md │ │ └── service_prometheus.md │ └── setup │ └── README.md ├── example_config ├── README.md ├── data_pipelines │ ├── file-delimiter.yaml │ ├── file-grok.yaml │ ├── file-json.yaml │ ├── input_command.json │ ├── input_command.yaml │ ├── multiline_java_stack_trace-split_log_regex.yaml │ └── nginx-regex.yaml ├── processor_grok_patterns │ ├── aws │ ├── bacula │ ├── bind │ ├── bro │ ├── exim │ ├── firewall │ ├── grok-patterns │ ├── haproxy │ ├── httpd │ ├── java │ ├── junos │ ├── linux-syslog │ ├── maven │ ├── mcollective │ ├── mcollective-patterns │ ├── mongodb │ ├── nagios │ ├── postgresql │ ├── rails │ ├── redis │ ├── ruby │ └── squid ├── quick_start │ ├── config │ │ └── file_simple.yaml │ └── loongcollector_config.json ├── start_with_docker │ ├── config │ │ ├── file_simple.yaml │ │ └── stdout_simple.yaml │ └── loongcollector_config.json ├── start_with_k8s │ ├── loongcollector-daemonset.yaml │ ├── loongcollector-ns.yaml │ ├── loongcollector-secret.yaml │ ├── loongcollector-user-configmap.yaml │ └── nginx-deployment.yaml └── user_contrib │ ├── Git-commit-log.md │ ├── c++-glog.md │ ├── com.west2online.ClashX.log.md │ ├── django-api-access-log.md │ ├── django-user-debug-log.md │ ├── golang-zap.md │ ├── high-resolution-time-raw-log.md │ ├── hpc-thunderbird-log-info.md │ ├── java-springboot-logback.md │ ├── linux-apache-errorlog.md │ ├── linux-bash-dpkg.md │ ├── linux-bash-history.md │ ├── linux-kern-log.md │ ├── linux-mysql-error-log.md │ ├── linux-secure-log.md │ ├── linux-tcpdump.md │ ├── linux-var-log-auth.md │ ├── mysql-slow-log.md │ ├── nginx-json-access-log.md │ ├── python-loguru-logger.md │ ├── redis-monitor.md │ ├── rsync-log-file.md │ ├── swift-alliance-access-and-awp-audit.md │ ├── swift-alliance-gateway-audit.md │ ├── vivado-synth-log.md │ ├── windows-logs-CBS.md │ └── windows-vscode-sign.md ├── external ├── README.md └── github.com │ ├── aliyun │ └── alibaba-cloud-sdk-go │ │ └── services │ │ └── sls_inner │ │ ├── analyze_product_log.go │ │ ├── check_resource.go │ │ ├── client.go │ │ ├── close_acceleration.go │ │ ├── delete_log_resource.go │ │ ├── get_acceleration.go │ │ ├── go.mod │ │ ├── logical_delete_resource.go │ │ ├── open_acceleration.go │ │ ├── open_account.go │ │ ├── order_succeeded_callback.go │ │ ├── physical_delete_resource.go │ │ └── struct_acceleration_model.go │ ├── elastic │ └── beats │ │ └── v7 │ │ ├── go.mod │ │ ├── libbeat │ │ ├── common │ │ │ └── file │ │ │ │ ├── file_other.go │ │ │ │ ├── file_windows.go │ │ │ │ ├── fileinfo.go │ │ │ │ ├── fileinfo_unix.go │ │ │ │ ├── fileinfo_windows.go │ │ │ │ ├── helper_other.go │ │ │ │ ├── helper_windows.go │ │ │ │ └── rotator.go │ │ ├── logp │ │ │ ├── config.go │ │ │ ├── core.go │ │ │ ├── encoding.go │ │ │ ├── eventlog_unsupported.go │ │ │ ├── eventlog_windows.go │ │ │ ├── fields.go │ │ │ ├── global.go │ │ │ ├── level.go │ │ │ ├── logger.go │ │ │ ├── options.go │ │ │ ├── selective.go │ │ │ ├── syslog_unix.go │ │ │ └── syslog_unsupported.go │ │ └── paths │ │ │ └── paths.go │ │ └── winlogbeat │ │ └── sys │ │ ├── buffer.go │ │ ├── buffer_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── event.go │ │ ├── event_test.go │ │ ├── eventlogging │ │ ├── doc.go │ │ ├── eventlogging_windows.go │ │ ├── stringinserts_windows.go │ │ ├── syscall_windows.go │ │ ├── syscall_windows_test.go │ │ └── zsyscall_windows.go │ │ ├── msgfile.go │ │ ├── sid.go │ │ ├── sid_test.go │ │ ├── sid_windows.go │ │ ├── strings.go │ │ ├── strings_test.go │ │ ├── wineventlog │ │ ├── bookmark.go │ │ ├── bookmark_test.go │ │ ├── bufferpool.go │ │ ├── doc.go │ │ ├── format_message.go │ │ ├── format_message_test.go │ │ ├── iterator.go │ │ ├── iterator_test.go │ │ ├── metadata_store.go │ │ ├── metadata_store_test.go │ │ ├── publisher_metadata.go │ │ ├── publisher_metadata_test.go │ │ ├── query.go │ │ ├── query_test.go │ │ ├── renderer.go │ │ ├── stringinserts.go │ │ ├── stringinserts_test.go │ │ ├── syscall_windows.go │ │ ├── template.go │ │ ├── template_test.go │ │ ├── testdata │ │ │ ├── application-windows-error-reporting.evtx │ │ │ └── sysmon-9.01.evtx │ │ ├── util_test.go │ │ ├── wineventlog_windows.go │ │ ├── wineventlog_windows_test.go │ │ ├── winmeta.go │ │ └── zsyscall_windows.go │ │ └── xmlreader.go │ └── jeromer │ └── syslogparser │ ├── .gitignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── go.mod │ ├── rfc3164 │ ├── example_test.go │ ├── rfc3164.go │ └── rfc3164_test.go │ ├── syslogparser.go │ └── syslogparser_test.go ├── go.mod ├── go.sum ├── k8s_templates ├── README.md ├── ilogtail-daemonset-file-to-kafka.yaml ├── ilogtail-daemonset-file-to-sls.yaml ├── ilogtail-daemonset-stdout-to-kafka.yaml ├── ilogtail-daemonset-stdout-to-sls.yaml ├── ilogtail-sidecar-file-to-kafka.yaml └── ilogtail-sidecar-file-to-sls.yaml ├── licenses ├── LICENSE-VictoriaMetrics ├── LICENSE-beats ├── LICENSE-curl ├── LICENSE-go-mysql ├── LICENSE-gonvml ├── LICENSE-japronto ├── LICENSE-journalbeat ├── LICENSE-kubernetes ├── LICENSE-murmurhash3 ├── LICENSE-picohttpparser ├── LICENSE-pixie ├── LICENSE-spdlog ├── LICENSE-strptime ├── LICENSE-syslogparser ├── LICENSE-telegraf ├── LICENSE-xxhash ├── LICENSE_LRUCACHE11 ├── LICENSE_OF_ILOGTAIL_CPP_DEPENDENCIES.md ├── LICENSE_OF_ILOGTAIL_DEPENDENCIES.md ├── LICENSE_OF_TESTENGINE_DEPENDENCIES.md ├── LICENSE_concurrentqueue └── LICENSE_magic_enum ├── pkg ├── config │ ├── config.go │ └── global_config.go ├── constraints │ └── constraints.go ├── context.go ├── doc │ ├── doc.go │ ├── generate.go │ └── generate_test.go ├── flags │ ├── flags.go │ └── flags_test.go ├── fmtstr │ ├── format_index.go │ ├── format_index_test.go │ ├── format_timestamp.go │ ├── format_timestamp_test.go │ ├── format_topic.go │ ├── format_topic_test.go │ ├── formatstring.go │ └── formatstring_test.go ├── go.mod ├── go.sum ├── helper │ ├── async │ │ └── count_helper.go │ ├── collector_imp.go │ ├── containercenter │ │ ├── container_center.go │ │ ├── container_center_file_discover.go │ │ ├── container_center_file_discover_test.go │ │ ├── container_center_test.go │ │ ├── container_config.go │ │ ├── container_discover_controller.go │ │ ├── container_export.go │ │ ├── container_export_test.go │ │ ├── cri_adapter.go │ │ ├── cri_adapter_test.go │ │ ├── cri_helper.go │ │ ├── cri_helper_others.go │ │ ├── cri_helper_windows.go │ │ ├── cri_runtime_api_interface.go │ │ ├── cri_runtime_api_interface_test.go │ │ ├── cri_runtime_api_v1_adapter.go │ │ ├── cri_runtime_api_v1alpha2_adapter.go │ │ ├── mount_others.go │ │ ├── mount_windows.go │ │ ├── mount_windows_test.go │ │ ├── process_helper_linux.go │ │ └── process_helper_others.go │ ├── converter_helper.go │ ├── dumper.go │ ├── dumper_test.go │ ├── env_tags.go │ ├── env_tags_test.go │ ├── eventrecorder │ │ ├── event_define.go │ │ └── event_recorder.go │ ├── file_helper_darwin.go │ ├── file_helper_linux.go │ ├── file_helper_windows.go │ ├── go_kit_log_wrapper.go │ ├── grpc_helper.go │ ├── input_manager_helper.go │ ├── input_manager_helper_test.go │ ├── k8s.go │ ├── k8s_test.go │ ├── k8smeta │ │ ├── k8s_meta_cache.go │ │ ├── k8s_meta_const.go │ │ ├── k8s_meta_deferred_deletion_meta_store.go │ │ ├── k8s_meta_deferred_deletion_meta_store_test.go │ │ ├── k8s_meta_http_server.go │ │ ├── k8s_meta_http_server_test.go │ │ ├── k8s_meta_link.go │ │ ├── k8s_meta_link_test.go │ │ ├── k8s_meta_manager.go │ │ ├── k8s_meta_store_interface.go │ │ └── label_matcher.go │ ├── local_collector.go │ ├── local_context.go │ ├── log_file_processor.go │ ├── log_file_reader.go │ ├── log_file_reader_test.go │ ├── log_helper.go │ ├── log_helper_test.go │ ├── math │ │ ├── math_helper.go │ │ └── math_helper_test.go │ ├── meta_helper.go │ ├── meta_helper_easyjson.go │ ├── net.go │ ├── path_helper.go │ ├── path_helper_test.go │ ├── pipeline_event_helper.go │ ├── platformmeta │ │ ├── aliyun_ecs.go │ │ ├── interface.go │ │ └── mock.go │ ├── pool │ │ ├── pool_helper.go │ │ └── pool_helper_test.go │ ├── probe_http.go │ ├── profile │ │ ├── meta.go │ │ ├── meta_test.go │ │ └── pyroscope │ │ │ ├── LICENSE │ │ │ ├── jfr │ │ │ ├── jfr.go │ │ │ ├── jfr_labels.pb.go │ │ │ ├── jfr_labels.proto │ │ │ ├── jfr_test.go │ │ │ ├── parser.go │ │ │ └── testdata │ │ │ │ ├── example.jfr.gz │ │ │ │ ├── example_parsed.json.gz │ │ │ │ ├── jfr.raw │ │ │ │ └── jfr_labels.raw │ │ │ ├── pprof │ │ │ ├── pprof.go │ │ │ ├── pprof_test.go │ │ │ ├── pyroscope.go │ │ │ └── testdata │ │ │ │ └── cpu.pb.gz │ │ │ └── raw │ │ │ └── profile.go │ ├── service_helper.go │ ├── slice_helper.go │ ├── slice_helper_test.go │ ├── split_log_helper.go │ └── split_log_helper_test.go ├── logger │ ├── flag_test.go │ ├── logger.go │ ├── logger_test.go │ ├── memory_output.go │ ├── option.go │ ├── option_test.go │ └── test │ │ └── test_logger.go ├── logtail │ ├── GoPluginAdapter.dll │ ├── LogtailPluginAdapter.h │ ├── libGoPluginAdapter.so │ └── logtail.go ├── models │ ├── bytes.go │ ├── common.go │ ├── common_test.go │ ├── factory.go │ ├── logs.go │ ├── metrics.go │ ├── pipeline.go │ └── span.go ├── pipeline │ ├── aggregator.go │ ├── collector.go │ ├── context.go │ ├── control.go │ ├── extension.go │ ├── extensions │ │ ├── authenticator.go │ │ ├── decoder.go │ │ ├── encoder.go │ │ ├── extension_helper.go │ │ ├── flush_interceptor.go │ │ └── request_interceptor.go │ ├── flusher.go │ ├── input.go │ ├── loggroup_queue.go │ ├── pipeline.go │ ├── pipeline_collector.go │ ├── plugin.go │ └── processor.go ├── protocol │ ├── converter │ │ ├── converter.go │ │ ├── converter_raw.go │ │ ├── converter_raw_test.go │ │ ├── converter_single_log_flatten.go │ │ ├── converter_single_log_flatten_test.go │ │ ├── converter_sls_metric.go │ │ ├── converter_sls_metric_test.go │ │ ├── converter_test.go │ │ ├── custom_single_log.go │ │ ├── custom_single_log_test.go │ │ ├── influxdb_metric.go │ │ ├── influxdb_metric_test.go │ │ ├── jsonline.go │ │ ├── jsonline_test.go │ │ ├── otlp.go │ │ └── otlp_test.go │ ├── decoder │ │ ├── common │ │ │ └── comon.go │ │ ├── decoder.go │ │ ├── influxdb │ │ │ ├── decoder.go │ │ │ └── decoder_test.go │ │ ├── opentelemetry │ │ │ ├── decoder.go │ │ │ ├── decoder_test.go │ │ │ ├── otlpDataToPielineGroupEvents.go │ │ │ ├── otlpDataToSLSProto.go │ │ │ ├── otlp_metric_parser.go │ │ │ └── otlp_trace_parser.go │ │ ├── prometheus │ │ │ ├── decoder.go │ │ │ └── decoder_test.go │ │ ├── pyroscope │ │ │ ├── decoder.go │ │ │ ├── decoder_test.go │ │ │ └── test │ │ │ │ └── dump_pprof_mem_data │ │ ├── raw │ │ │ ├── decoder.go │ │ │ └── decoder_test.go │ │ ├── sls │ │ │ └── decoder.go │ │ └── statsd │ │ │ └── decoder.go │ ├── encoder │ │ ├── common │ │ │ └── common.go │ │ ├── encoder.go │ │ └── prometheus │ │ │ ├── encoder_prometheus.go │ │ │ ├── encoder_prometheus_test.go │ │ │ ├── utils.go │ │ │ └── utils_test.go │ ├── log_event.pb.go │ ├── metric_event.pb.go │ ├── otlp │ │ ├── constant.go │ │ ├── log_helper.go │ │ ├── metric_helper.go │ │ └── metric_helper_test.go │ ├── pipeline_event_group.pb.go │ ├── proto │ │ ├── README.md │ │ ├── genernate.sh │ │ ├── sls_logs.proto │ │ └── sls_logs_transfer.proto │ ├── sls_logs.pb.go │ ├── sls_logs.pb.helper.go │ ├── sls_logs_pool.go │ ├── sls_logs_transfer.pb.go │ └── span_event.pb.go ├── selfmonitor │ ├── metrics_constants_agent.go │ ├── metrics_constants_plugin.go │ ├── metrics_constants_runner.go │ ├── metrics_imp.go │ ├── metrics_imp_test.go │ ├── metrics_imp_v2.go │ ├── metrics_imp_v2_test.go │ ├── metrics_record.go │ ├── metrics_record_test.go │ ├── metrics_type.go │ ├── metrics_vector_imp.go │ └── metrics_vector_imp_test.go ├── signals │ ├── signal.go │ ├── signal_posix.go │ └── signal_windows.go ├── tlscommon │ └── tls_config.go └── util │ ├── LogtailAlarm.go │ ├── alarm.go │ ├── net_helper.go │ ├── string_helper.go │ ├── string_helper_test.go │ ├── timeout_reader.go │ ├── util.go │ └── util_test.go ├── plugin_main ├── plugin_export.go ├── plugin_http.go ├── plugin_main.go ├── plugin_main_test.go └── wrapmemcpy │ ├── wrap_memcpy.go │ ├── wrap_memcpy.h │ └── wrap_memcpy_others.go ├── pluginmanager ├── checkpoint_manager.go ├── checkpoint_manager_test.go ├── config_update_test.go ├── container_config_manager.go ├── container_config_manager_test.go ├── context_imp.go ├── flusher_out_store.go ├── logstore_config.go ├── logstore_config_test.go ├── logtail_port_manager.go ├── logtail_port_manager_test.go ├── metric_export.go ├── plugin_manager.go ├── plugin_manager_test.go ├── plugin_runner.go ├── plugin_runner_helper.go ├── plugin_runner_test.go ├── plugin_runner_v1.go ├── plugin_runner_v2.go ├── plugin_runner_v2_test.go ├── plugin_wrapper.go ├── plugin_wrapper_aggregator_v1.go ├── plugin_wrapper_aggregator_v2.go ├── plugin_wrapper_flusher_v1.go ├── plugin_wrapper_flusher_v2.go ├── plugin_wrapper_metric_v1.go ├── plugin_wrapper_metric_v2.go ├── plugin_wrapper_processor_v1.go ├── plugin_wrapper_processor_v2.go ├── plugin_wrapper_service_v1.go ├── plugin_wrapper_service_v2.go ├── processor_tag.go ├── processor_tag_helper.go ├── processor_tag_test.go ├── self_telemetry_alarm.go ├── self_telemetry_container_config.go └── test_config │ ├── update_mock_block.json │ ├── update_mock_noblock.json │ └── update_mock_noblock_no_input.json ├── plugins.yml ├── plugins ├── aggregator │ ├── aggregator_default.go │ ├── baseagg │ │ ├── aggregator_base.go │ │ ├── aggregator_base_test.go │ │ └── doc.go │ ├── contentvaluegroup │ │ ├── aggregator_content_value_group.go │ │ └── aggregator_content_value_group_test.go │ ├── context │ │ ├── aggregator_context.go │ │ └── aggregator_context_test.go │ ├── logstorerouter │ │ └── aggregator_router.go │ ├── metadatagroup │ │ ├── aggregator_metadata_group.go │ │ └── aggregator_metadata_group_test.go │ ├── opentelemetry │ │ └── aggregator_opentelemetry.go │ ├── shardhash │ │ ├── aggregator_shardhash.go │ │ └── aggregator_shardhash_test.go │ └── skywalking │ │ └── aggregator_skywalking.go ├── all │ └── init.go ├── extension │ ├── basicauth │ │ └── basicauth.go │ ├── default_decoder │ │ ├── default_decoder.go │ │ └── default_decoder_test.go │ ├── default_encoder │ │ ├── default_encoder.go │ │ └── default_encoder_test.go │ ├── group_info_filter │ │ └── group_info_filter.go │ └── request_breaker │ │ └── request_breaker.go ├── flusher │ ├── checker │ │ └── flusher_checker.go │ ├── clickhouse │ │ ├── authentication.go │ │ ├── flusher_clickhouse.go │ │ └── flusher_clickhouse_test.go │ ├── elasticsearch │ │ ├── authentication.go │ │ ├── flusher_elasticsearch.go │ │ └── flusher_elasticsearch_test.go │ ├── grpc │ │ ├── flusher.go │ │ └── flusher_test.go │ ├── http │ │ ├── flusher_http.go │ │ └── flusher_http_test.go │ ├── kafka │ │ ├── flusher_kafka.go │ │ └── flusher_kafka_test.go │ ├── kafkav2 │ │ ├── authentication.go │ │ ├── flusher_kafka_v2.go │ │ ├── flusher_kafka_v2_test.go │ │ ├── kafka_version.go │ │ └── scram_client.go │ ├── loki │ │ └── flusher_loki.go │ ├── opentelemetry │ │ ├── flusher_otlp.go │ │ └── flusher_otlp_test.go │ ├── prometheus │ │ ├── config.go │ │ ├── def.go │ │ ├── flusher_prometheus.go │ │ ├── flusher_prometheus_test.go │ │ └── validate.go │ ├── pulsar │ │ ├── authentication.go │ │ ├── flusher_pulsar.go │ │ └── producers.go │ ├── sleep │ │ └── flusher_sleep.go │ ├── sls │ │ └── flusher_sls.go │ ├── statistics │ │ └── flusher_statistics.go │ └── stdout │ │ └── flusher_stdout.go ├── input │ ├── canal │ │ └── input_canal.go │ ├── command │ │ ├── command_const.go │ │ ├── command_script_storage.go │ │ ├── input_command.go │ │ └── input_command_test.go │ ├── debugfile │ │ └── input_debug_file.go │ ├── docker │ │ ├── event │ │ │ └── input_docker_event.go │ │ ├── logmeta │ │ │ ├── metric_container_info.go │ │ │ └── metric_container_info_test.go │ │ ├── rawstdout │ │ │ └── input_docker_stdout.go │ │ └── stdout │ │ │ ├── big_data.json │ │ │ ├── docker_stdout_processor.go │ │ │ ├── docker_stdout_processor_test.go │ │ │ ├── docker_stdout_struct_easyjson.go │ │ │ ├── input_docker_stdout.go │ │ │ └── input_docker_stdout_test.go │ ├── example │ │ ├── metric_checkpoint_example.go │ │ ├── metric_example.go │ │ ├── metric_example_input.json │ │ ├── service_example.go │ │ └── service_example_input.json │ ├── goprofile │ │ ├── discovery_kubernetes.go │ │ ├── discovery_static.go │ │ ├── golang_profile.go │ │ └── manager.go │ ├── gpu │ │ └── input_gpu_metric.go │ ├── hostmeta │ │ ├── host_meta_collect.go │ │ ├── input_host_meta.go │ │ ├── input_host_meta_benchmark_test.go │ │ ├── input_host_meta_linux.go │ │ ├── input_host_meta_other.go │ │ └── input_host_meta_test.go │ ├── http │ │ └── input_http.go │ ├── httpserver │ │ ├── input_http_server.go │ │ └── input_http_server_test.go │ ├── input_wineventlog │ │ ├── eventlog │ │ │ ├── cache.go │ │ │ ├── common │ │ │ │ ├── cache.go │ │ │ │ ├── cache_test.go │ │ │ │ └── doc.go │ │ │ ├── doc.go │ │ │ ├── eventlog.go │ │ │ ├── eventlogging.go │ │ │ ├── factory.go │ │ │ ├── retry.go │ │ │ └── wineventlog.go │ │ └── wineventlog.go │ ├── jmxfetch │ │ ├── jmxfetch.go │ │ ├── jmxfetch_inner.go │ │ ├── jmxfetch_log_collector.go │ │ ├── jmxfetch_log_file_processor.go │ │ ├── jmxfetch_log_file_processor_test.go │ │ ├── jmxfetchd.go │ │ ├── manager.go │ │ └── manager_test.go │ ├── journal │ │ ├── follow.go │ │ ├── input_journal.go │ │ └── unit.go │ ├── kafka │ │ ├── input_kafka.go │ │ └── input_kafka_test.go │ ├── kubernetesmetav1 │ │ ├── crd_open_kruise.go │ │ ├── input_kubernetes_meta.go │ │ ├── input_kubernetes_meta_test.go │ │ ├── kubernetes_collect.go │ │ ├── kubernetes_collect_apps.go │ │ ├── kubernetes_collect_batch.go │ │ ├── kubernetes_collect_core.go │ │ ├── kubernetes_collect_core_test.go │ │ ├── kubernetes_collect_networking.go │ │ └── kubernetes_collect_storage.go │ ├── kubernetesmetav2 │ │ ├── meta_collector.go │ │ ├── meta_collector_app.go │ │ ├── meta_collector_app_test.go │ │ ├── meta_collector_batch.go │ │ ├── meta_collector_batch_test.go │ │ ├── meta_collector_const.go │ │ ├── meta_collector_core.go │ │ ├── meta_collector_core_test.go │ │ ├── meta_collector_networking.go │ │ ├── meta_collector_networking_test.go │ │ ├── meta_collector_storage.go │ │ ├── meta_collector_storage_test.go │ │ ├── meta_collector_test.go │ │ └── service_meta.go │ ├── lumberjack │ │ └── input_lumberjack.go │ ├── mock │ │ └── input_mock.go │ ├── mockd │ │ └── input_mockd.go │ ├── mqtt │ │ └── input_mqtt.go │ ├── mysql │ │ └── mysql.go │ ├── mysqlbinlog │ │ ├── input_mysql_binlog.go │ │ └── mysql_binlog_helper.go │ ├── netping │ │ ├── netping.go │ │ ├── netping.json │ │ └── netping_test.go │ ├── nginx │ │ └── input_nginx.go │ ├── opentelemetry │ │ ├── receiver.go │ │ ├── service_oltp.go │ │ ├── service_otlp_test.go │ │ └── service_otlp_v1_test.go │ ├── plugin_name.go │ ├── process │ │ ├── input_process.go │ │ ├── input_process_benchmark_test.go │ │ ├── input_process_cache.go │ │ ├── input_process_cache_linux.go │ │ ├── input_process_cache_other.go │ │ ├── input_process_linux_test.go │ │ ├── input_process_other_test.go │ │ └── input_process_test.go │ ├── prometheus │ │ ├── input_prometheus.go │ │ ├── kubernetes_cluster_mode.go │ │ └── sls_writer.go │ ├── rdb │ │ ├── mssql │ │ │ └── mssql.go │ │ ├── pgsql │ │ │ └── pgsql.go │ │ └── rdb.go │ ├── redis │ │ └── input_redis.go │ ├── skywalkingv2 │ │ ├── application_cache.go │ │ ├── application_cache_test.go │ │ ├── application_register_handle.go │ │ ├── code-gen.sh │ │ ├── input_skywalking_agent_v2.go │ │ ├── instance_discovery_handle.go │ │ ├── jvm_metric_handle.go │ │ ├── jvm_metric_report_handle.go │ │ ├── network_address_register_handle.go │ │ ├── proto │ │ │ ├── README.md │ │ │ ├── common │ │ │ │ ├── CLR.proto │ │ │ │ ├── JVM.proto │ │ │ │ ├── common.proto │ │ │ │ └── trace-common.proto │ │ │ ├── language-agent-v2 │ │ │ │ ├── CLRMetric.proto │ │ │ │ ├── JVMMetric.proto │ │ │ │ └── trace.proto │ │ │ ├── language-agent │ │ │ │ ├── ApplicationRegisterService.proto │ │ │ │ ├── DiscoveryService.proto │ │ │ │ ├── Downstream.proto │ │ │ │ ├── JVMMetricsService.proto │ │ │ │ ├── KeyWithIntegerValue.proto │ │ │ │ ├── KeyWithStringValue.proto │ │ │ │ ├── NetworkAddressRegisterService.proto │ │ │ │ └── TraceSegmentService.proto │ │ │ ├── register │ │ │ │ ├── InstancePing.proto │ │ │ │ └── Register.proto │ │ │ └── service-mesh-probe │ │ │ │ ├── istio │ │ │ │ └── skywalking.config.pb.html │ │ │ │ └── service-mesh.proto │ │ ├── register_handle.go │ │ ├── service_instance_ping_handle.go │ │ ├── service_name_discovery_handle.go │ │ ├── skywalking │ │ │ └── apm │ │ │ │ └── network │ │ │ │ ├── common │ │ │ │ └── common.pb.go │ │ │ │ └── language │ │ │ │ └── agent │ │ │ │ ├── ApplicationRegisterService.pb.go │ │ │ │ ├── ApplicationRegisterService_grpc.pb.go │ │ │ │ ├── CLR.pb.go │ │ │ │ ├── DiscoveryService.pb.go │ │ │ │ ├── DiscoveryService_grpc.pb.go │ │ │ │ ├── Downstream.pb.go │ │ │ │ ├── InstancePing.pb.go │ │ │ │ ├── InstancePing_grpc.pb.go │ │ │ │ ├── JVM.pb.go │ │ │ │ ├── JVMMetricsService.pb.go │ │ │ │ ├── JVMMetricsService_grpc.pb.go │ │ │ │ ├── KeyWithIntegerValue.pb.go │ │ │ │ ├── KeyWithStringValue.pb.go │ │ │ │ ├── NetworkAddressRegisterService.pb.go │ │ │ │ ├── NetworkAddressRegisterService_grpc.pb.go │ │ │ │ ├── Register.pb.go │ │ │ │ ├── Register_grpc.pb.go │ │ │ │ ├── TraceSegmentService.pb.go │ │ │ │ ├── TraceSegmentService_grpc.pb.go │ │ │ │ ├── trace-common.pb.go │ │ │ │ └── v2 │ │ │ │ ├── CLRMetric.pb.go │ │ │ │ ├── CLRMetric_grpc.pb.go │ │ │ │ ├── JVMMetric.pb.go │ │ │ │ ├── JVMMetric_grpc.pb.go │ │ │ │ ├── trace.pb.go │ │ │ │ └── trace_grpc.pb.go │ │ ├── trace_segment_handle.go │ │ └── trace_segment_report_handle.go │ ├── skywalkingv3 │ │ ├── clr_metric_handle.go │ │ ├── clr_metric_handle_test.go │ │ ├── configuration_discovery_handler.go │ │ ├── id_analyze.go.bak │ │ ├── input_skywalking_agent_v3.go │ │ ├── input_skywalking_agent_v3_http.go │ │ ├── jvm_metric_handle.go │ │ ├── jvm_metric_handle_test.go │ │ ├── logging_handle.go │ │ ├── logging_handle_test.go │ │ ├── management_handle.go │ │ ├── meter_handle.go │ │ ├── meter_handle_test.go │ │ ├── opentelemetry.go │ │ ├── ot_trace.go │ │ ├── perfdata_handler.go │ │ ├── profile_handle.go │ │ ├── proto-gen.sh │ │ ├── proto │ │ │ ├── .asf.yaml │ │ │ ├── .bazelrc │ │ │ ├── .github │ │ │ │ └── workflows │ │ │ │ │ └── ci.yaml │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── WORKSPACE │ │ │ ├── bazel │ │ │ │ ├── BUILD │ │ │ │ └── repositories.bzl │ │ │ ├── browser │ │ │ │ ├── BrowserPerf.proto │ │ │ │ └── BrowserPerfCompat.proto │ │ │ ├── common │ │ │ │ ├── BUILD │ │ │ │ └── Common.proto │ │ │ ├── event │ │ │ │ └── Event.proto │ │ │ ├── language-agent │ │ │ │ ├── BUILD │ │ │ │ ├── CLRMetric.proto │ │ │ │ ├── CLRMetricCompat.proto │ │ │ │ ├── ConfigurationDiscoveryService.proto │ │ │ │ ├── JVMMetric.proto │ │ │ │ ├── JVMMetricCompat.proto │ │ │ │ ├── Meter.proto │ │ │ │ ├── MeterCompat.proto │ │ │ │ ├── Tracing.proto │ │ │ │ └── TracingCompat.proto │ │ │ ├── logging │ │ │ │ └── Logging.proto │ │ │ ├── management │ │ │ │ ├── Management.proto │ │ │ │ └── ManagementCompat.proto │ │ │ ├── profile │ │ │ │ ├── Profile.proto │ │ │ │ └── ProfileCompat.proto │ │ │ ├── service-mesh-probe │ │ │ │ ├── service-mesh-compat.proto │ │ │ │ └── service-mesh.proto │ │ │ └── tools │ │ │ │ └── check-license-header.py │ │ ├── segment_analyze.go │ │ ├── skywalking │ │ │ └── network │ │ │ │ ├── agent │ │ │ │ └── configuration │ │ │ │ │ └── v3 │ │ │ │ │ ├── ConfigurationDiscoveryService.pb.go │ │ │ │ │ └── ConfigurationDiscoveryService_grpc.pb.go │ │ │ │ ├── common │ │ │ │ └── v3 │ │ │ │ │ └── Common.pb.go │ │ │ │ ├── language │ │ │ │ ├── agent │ │ │ │ │ └── v3 │ │ │ │ │ │ ├── BrowserPerf.pb.go │ │ │ │ │ │ ├── BrowserPerf_grpc.pb.go │ │ │ │ │ │ ├── CLRMetric.pb.go │ │ │ │ │ │ ├── CLRMetric_grpc.pb.go │ │ │ │ │ │ ├── JVMMetric.pb.go │ │ │ │ │ │ ├── JVMMetric_grpc.pb.go │ │ │ │ │ │ ├── Meter.pb.go │ │ │ │ │ │ ├── Meter_grpc.pb.go │ │ │ │ │ │ ├── Tracing.pb.go │ │ │ │ │ │ └── Tracing_grpc.pb.go │ │ │ │ └── profile │ │ │ │ │ └── v3 │ │ │ │ │ ├── Profile.pb.go │ │ │ │ │ ├── Profile_grpc.pb.go │ │ │ │ │ └── compat │ │ │ │ │ ├── ProfileCompat.pb.go │ │ │ │ │ └── ProfileCompat_grpc.pb.go │ │ │ │ ├── logging │ │ │ │ └── v3 │ │ │ │ │ ├── Logging.pb.go │ │ │ │ │ └── Logging_grpc.pb.go │ │ │ │ └── management │ │ │ │ └── v3 │ │ │ │ ├── Management.pb.go │ │ │ │ └── Management_grpc.pb.go │ │ ├── testdata │ │ │ ├── clr_metrics.json │ │ │ ├── jvm_metrics.json │ │ │ ├── logging.json │ │ │ ├── meter_histogram.json │ │ │ ├── meter_singlevalue.json │ │ │ └── trace.json │ │ ├── trace_analyze.go.bak │ │ ├── tracing_handle.go │ │ └── tracing_handle_test.go │ ├── snmp │ │ ├── input_snmp.go │ │ └── input_snmp_test.go │ ├── syslog │ │ ├── backoff.go │ │ ├── backoff_test.go │ │ ├── parser.go │ │ ├── parser_test.go │ │ ├── syslog.go │ │ └── syslog_test.go │ ├── system │ │ └── input_system.go │ ├── systemv2 │ │ ├── input_system_linux.go │ │ ├── input_system_linux_test.go │ │ ├── input_system_others.go │ │ └── input_system_v2.go │ ├── telegraf │ │ ├── input_telegraf.go │ │ ├── local_test │ │ │ ├── telegraf_test.conf │ │ │ └── telegrafd │ │ ├── telegraf_log_collector.go │ │ ├── telegraf_log_collector_test.go │ │ ├── telegraf_log_file_processor.go │ │ ├── telegraf_manager.go │ │ └── telegraf_manager_test.go │ └── udpserver │ │ ├── input_udp.go │ │ ├── shared_udp_server.go │ │ └── shared_udp_server_test.go ├── processor │ ├── addfields │ │ ├── example.json │ │ ├── processor_add_fields.go │ │ └── processor_add_fields_test.go │ ├── anchor │ │ ├── anchor.go │ │ └── anchor_test.go │ ├── appender │ │ ├── processor_appender.go │ │ └── processor_appender_test.go │ ├── base64 │ │ ├── decoding │ │ │ ├── processor_base64_decoding.go │ │ │ └── processor_base64_decoding_test.go │ │ └── encoding │ │ │ ├── processor_base64_encoding.go │ │ │ └── processor_base64_encoding_test.go │ ├── cloudmeta │ │ ├── cloud_meta.go │ │ └── cloud_meta_test.go │ ├── csv │ │ ├── example.json │ │ ├── processor_csv.go │ │ └── processor_csv_test.go │ ├── defaultone │ │ └── processor_default.go │ ├── desensitize │ │ ├── processor_desensitize.go │ │ └── processor_desensitize_test.go │ ├── dictmap │ │ ├── processor_dict_map.go │ │ ├── processor_dict_map_test.go │ │ └── testfile.csv │ ├── drop │ │ ├── processor_drop.go │ │ └── processor_drop_test.go │ ├── droplastkey │ │ ├── processor_drop_last_key.go │ │ └── processor_drop_last_key_test.go │ ├── encrypt │ │ ├── processor_encrypt.go │ │ └── processor_encrypt_test.go │ ├── fieldswithcondition │ │ ├── example.json │ │ ├── processor_fields_with_condition.go │ │ └── processor_fields_with_condition_test.go │ ├── filter │ │ ├── keyregex │ │ │ ├── filter_key_regex_test.go │ │ │ └── processor_filter_key_regex.go │ │ └── regex │ │ │ ├── filter_regex_test.go │ │ │ └── processor_filter_regex.go │ ├── geoip │ │ ├── geoip_test.go │ │ └── processor_geoip.go │ ├── gotime │ │ ├── processor_gotime.go │ │ └── processor_gotime_test.go │ ├── grok │ │ ├── processor_grok.go │ │ ├── processor_grok_benchmark_test.go │ │ ├── processor_grok_default_patterns.go │ │ ├── processor_grok_test.go │ │ └── test_patterns │ │ │ ├── aws │ │ │ └── grok-patterns │ ├── json │ │ ├── processor_json.go │ │ └── processor_json_test.go │ ├── logtoslsmetric │ │ ├── processor_log_to_sls_metric.go │ │ ├── processor_log_to_sls_metric_benchmark_test.go │ │ └── processor_log_to_sls_metric_test.go │ ├── md5 │ │ ├── processor_md5.go │ │ └── processor_md5_test.go │ ├── otel │ │ ├── processor_otel_metric.go │ │ ├── processor_otel_metric_test.go │ │ ├── processor_otel_trace.go │ │ └── processor_otel_trace_test.go │ ├── packjson │ │ ├── processor_packjson.go │ │ └── processor_packjson_test.go │ ├── pickkey │ │ ├── pick_key_test.go │ │ └── processor_pick_key.go │ ├── ratelimit │ │ ├── algorithm.go │ │ ├── processor_rate_limit.go │ │ ├── processor_rate_limit_test.go │ │ └── token_bucket.go │ ├── regex │ │ ├── regex.go │ │ ├── regex_benchmark_test.go │ │ └── regex_test.go │ ├── rename │ │ ├── processor_rename.go │ │ └── processor_rename_test.go │ ├── split │ │ ├── char │ │ │ ├── split_char.go │ │ │ └── split_char_test.go │ │ ├── keyvalue │ │ │ ├── key_value_splitter.go │ │ │ └── key_value_splitter_test.go │ │ ├── logregex │ │ │ ├── split_log_regex.go │ │ │ └── split_log_regex_test.go │ │ ├── logstring │ │ │ ├── split_log_string.go │ │ │ └── split_log_string_test.go │ │ └── string │ │ │ ├── split_string.go │ │ │ └── split_string_test.go │ ├── stringreplace │ │ ├── processor_string_replace.go │ │ └── processor_string_replace_test.go │ └── strptime │ │ ├── strptime.go │ │ └── strptime_test.go └── test │ ├── common.go │ └── mock │ └── context.go ├── protobuf_public └── models │ ├── log_event.proto │ ├── metric_event.proto │ ├── pipeline_event_group.proto │ └── span_event.proto ├── scripts ├── benchmark_collect_result.sh ├── build_edge_linux.sh ├── check_glibc.sh ├── dependency_licenses.sh ├── dist.sh ├── docker_build.sh ├── download_ebpflib.sh ├── e2e.sh ├── e2e_coverage.sh ├── gen_build_scripts.sh ├── gen_release_markdown.sh ├── import_plugins.sh ├── loongcollector_control.sh ├── package_license.sh ├── plugin_build.sh ├── plugin_gocbuild.sh ├── run_core_ut.sh ├── update_version.sh ├── upgrade_adapter_lib.sh ├── windows32_build.bat ├── windows64_build.bat └── windows64_dist.bat ├── test ├── benchmark │ ├── benchmark_docker_test.go │ └── test_cases │ │ ├── performance_file_to_blackhole_filebeat │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── filebeat.yml │ │ ├── performance_file_to_blackhole_fluentbit │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ ├── main.conf │ │ └── parsers.conf │ │ ├── performance_file_to_blackhole_loongcollector │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loongcollector.yaml │ │ ├── performance_file_to_blackhole_loongcollectorspl │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loongcollector.yaml │ │ ├── performance_file_to_blackhole_vector │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── vector.yaml │ │ ├── performance_file_to_file_filebeat │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── filebeat.yml │ │ ├── performance_file_to_file_fluentbit │ │ ├── case.feature │ │ ├── clear_files.sh │ │ ├── docker-compose.yaml │ │ ├── main.conf │ │ └── parsers.conf │ │ ├── performance_file_to_file_loongcollector │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loongcollector.yaml │ │ ├── performance_file_to_file_loongcollectorcgo │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loongcollector.yaml │ │ ├── performance_file_to_file_loongcollectorspl │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loongcollector.yaml │ │ └── performance_file_to_file_vector │ │ ├── case.feature │ │ ├── clear_files.sh │ │ ├── docker-compose.yaml │ │ └── vector.yaml ├── config │ ├── config.go │ ├── context.go │ └── load.go ├── dataflow.png ├── e2e │ ├── e2e_docker_test.go │ └── test_cases │ │ ├── aggregator_context │ │ ├── Dockerfile_1 │ │ ├── Dockerfile_2 │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh │ │ ├── flusher_clickhouse │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── flusher_elasticsearch │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── flusher_http │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── flusher_loki │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── loki-config.yaml │ │ ├── input_canal │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── client │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ │ └── docker-compose.yaml │ │ ├── input_canal_binfile_mode │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── client │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ │ └── docker-compose.yaml │ │ ├── input_container_stdio │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_container_stdio_multiline │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_docker_event │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_docker_rawstdout │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_docker_rawstdout_multiline │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_docker_static_file │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh │ │ ├── input_docker_stdout │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_docker_stdout_multiline │ │ ├── Dockerfile │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_http │ │ └── case.feature │ │ ├── input_http_server │ │ └── case.feature │ │ ├── input_mock_log │ │ └── case.feature │ │ ├── input_mock_metric │ │ └── case.feature │ │ ├── input_mssql │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ ├── entrypoint.sh │ │ └── init.sql │ │ ├── input_mysql │ │ ├── case.feature │ │ └── docker-compose.yaml │ │ ├── input_pgsql │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── init.sql │ │ ├── input_prometheus │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── exporter │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ │ ├── input_static_file │ │ ├── Dockerfile │ │ ├── a.log │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh │ │ ├── reader_deleted │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh │ │ ├── reader_flush_timeout │ │ ├── Dockerfile │ │ ├── a.log │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh │ │ ├── reader_log_rotate │ │ ├── Dockerfile │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ ├── run.sh │ │ └── volume │ │ │ └── simple.log │ │ └── reader_new_line_after_timeout │ │ ├── Dockerfile │ │ ├── a.log │ │ ├── case.feature │ │ ├── docker-compose.yaml │ │ └── run.sh ├── engine │ ├── cleanup │ │ ├── chaos.go │ │ ├── docker_compose.go │ │ ├── helper.go │ │ └── log.go │ ├── control │ │ ├── agent.go │ │ ├── config.go │ │ ├── kubernetes.go │ │ └── query.go │ ├── setup │ │ ├── chaos │ │ │ └── network.go │ │ ├── controller │ │ │ ├── docker_compose_boot.go │ │ │ └── kubernetes.go │ │ ├── docker_compose.go │ │ ├── dockercompose │ │ │ ├── common.go │ │ │ ├── compose.go │ │ │ └── compose_benchmark.go │ │ ├── env.go │ │ ├── host.go │ │ ├── k8s.go │ │ ├── monitor │ │ │ ├── monitor.go │ │ │ └── statistic.go │ │ └── subscriber │ │ │ ├── clickhouse.go │ │ │ ├── elasticsearch.go │ │ │ ├── grpc.go │ │ │ ├── influxdb.go │ │ │ ├── loki.go │ │ │ ├── sls.go │ │ │ └── subscriber.go │ ├── steps.go │ ├── trigger │ │ ├── ebpf │ │ │ ├── http.go │ │ │ ├── remote_mmap.py │ │ │ └── security.go │ │ ├── helper.go │ │ └── log │ │ │ ├── file.go │ │ │ ├── http_server.go │ │ │ ├── remote_file.py │ │ │ └── remote_file_benchmark.py │ └── verify │ │ ├── agent.go │ │ ├── count.go │ │ ├── log_context.go │ │ ├── log_field.go │ │ ├── log_label.go │ │ ├── log_order.go │ │ ├── log_tag.go │ │ └── sys_logtail_log.go ├── go.mod ├── go.sum ├── main.go └── requirements.txt └── tools ├── builder ├── config.go ├── main.go ├── main_test.go ├── templates.go ├── templates │ ├── all.go.tmpl │ ├── all_debug.go.tmpl │ ├── all_linux.go.tmpl │ ├── all_windows.go.tmpl │ └── go.mod.tmpl └── testdata │ └── external_plugins.yml └── coverage-diff └── main.py /.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | Add: 3 | - -fgnuc-version=9.3.1 4 | - -Wall 5 | - -Wextra 6 | # - -fno-access-control # 允许UT访问私有成员 7 | # - -DAPSARA_UNIT_TEST_MAIN # 允许编译UT特殊方法 8 | - -I/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include 9 | - -I/opt/logtail/deps/include 10 | CompilationDatabase: build 11 | 12 | Diagnostics: 13 | ClangTidy: 14 | Remove: [cppcoreguidelines-owning-memory] 15 | FastCheckFilter: Strict 16 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "dockerfile": "Dockerfile", 4 | "args": { 5 | "USERNAME": "${localEnv:USER}" 6 | } 7 | }, 8 | "initializeCommand": ".devcontainer/gen_env.sh", 9 | "privileged": true, 10 | "mounts": [ 11 | { "source": "/sys", "target": "/sys", "type": "bind" }, 12 | { "source": "/", "target": "/logtail_host", "type": "bind" } 13 | ], 14 | "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], 15 | "onCreateCommand": "sudo chown -R $(id -un):$(id -gn) /root", 16 | "customizations": { 17 | "vscode": { 18 | "extensions": [ 19 | "golang.Go", 20 | "ms-vscode.cpptools-extension-pack", 21 | "llvm-vs-code-extensions.vscode-clangd", 22 | "DavidAnson.vscode-markdownlint", 23 | "redhat.vscode-yaml", 24 | "bmalehorn.shell-syntax" 25 | ] 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json.lldb: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "dockerfile": "Dockerfile", 4 | "args": { 5 | "USERNAME": "${localEnv:USER}" 6 | } 7 | }, 8 | "initializeCommand": ".devcontainer/gen_env.sh", 9 | "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], 10 | "onCreateCommand": "sudo chown -R $(id -un):$(id -gn) /root", 11 | "customizations": { 12 | "vscode": { 13 | "extensions": [ 14 | "golang.Go", 15 | "ms-vscode.cpptools-extension-pack", 16 | "DavidAnson.vscode-markdownlint", 17 | "redhat.vscode-yaml", 18 | "bmalehorn.shell-syntax", 19 | "llvm-vs-code-extensions.vscode-clangd", 20 | "vadimcn.vscode-lldb" 21 | ] 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # ignore build artifacts 2 | 3 | build/ 4 | core/build/ 5 | -------------------------------------------------------------------------------- /.gitbook.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | root: ./docs/cn 16 | 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ask-a-question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask a question 3 | about: Ask anything of LoongCollector. It is recommended to ask a question in discussions. 4 | title: "[QUESTION]:" 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | Before asking a question, please first consider: 11 | 12 | - Searching [existing discussions](https://github.com/alibaba/loongcollector/discussions/) 13 | - Searching [existing issues](https://github.com/alibaba/loongcollector/issues/) 14 | - Searching [English Doc](https://github.com/alibaba/loongcollector/tree/main/docs/en) 15 | - Searching Google 16 | 17 | ------- 18 | 19 | 提问之前,建议先在 LoongCollector 社区寻找答案。 20 | 21 | - 查看 [存在的 discussions](https://github.com/alibaba/loongcollector/discussions/) 22 | - 查看 [存在的 issues](https://github.com/alibaba/loongcollector/issues/) 23 | - 查看 [中文文档](https://github.com/alibaba/loongcollector/tree/main/docs/cn) 24 | - 查看 Google 25 | 26 | 如果仍然无法找到答案,我们建议您在[discussions](https://github.com/alibaba/loongcollector/discussions/)进行提问。 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/awesome-ilogtail.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Awesome iLogtail 3 | about: Join the iLogtail ambanssadar program 4 | title: "[Publicity]:" 5 | labels: awesome ilogtail 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please post your Zhihu article link, WeChat article link or any proof of publicity here. 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]:" 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is, ideally within 20 words. 12 | 13 | **iLogtail Running Environment** 14 | Please provide the following information: 15 | 16 | - ilogtail version: 17 | 18 | - Yaml configuration: 19 | 20 | - ilogtail.LOG: 21 | 22 | - logtail_plugin.LOG: 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/doc.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Doc 3 | about: Have doubts or suggestions about ilogtail docs 4 | title: "[DOC]:" 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please describe any errors, ambiguities, or other improvement opportunities that you can find in the documentation. 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature enhancement 3 | about: Enhancement to existing features 4 | title: "[ENHANCEMENT]:" 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Concisely describe the proposed feature** 11 | A clear and concise description of what you want. For example, 12 | > The log format collected to Kafka is not friendly to subsequent processing 13 | 14 | **Describe the solution you'd like (if any)** 15 | A clear and concise description of what you want to achieve and implement. For example, 16 | > I would like to add an log flush method for flusher_kafka. 17 | 18 | **Additional comments** 19 | Add any other context or screenshots about the feature request here. 20 | For example, the ideal input and output logs. 21 | > The logs are supposed to have the following contents, e.g., 22 | > 23 | > ``` json 24 | > {"_target_":"127.0.0.1","_field_":"DISMAN-EXPRESSION-MIB::sysUpTimeInstance","_oid_":".1.3.6.1.2.1.1.3.0","_type_":"TimeTicks","_content_":"10423593"} 25 | > ``` 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "core/_thirdparty/coolbpf"] 2 | path = core/_thirdparty/coolbpf 3 | url = https://gitee.com/anolis/coolbpf.git 4 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD013": false, 3 | "MD024": {"siblings_only": true}, 4 | "MD033": false 5 | } 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Alibaba has adopted a Code of Conduct that we expect project participants to adhere to. 4 | 5 | Please refer to [Alibaba Open Source Code of Conduct](https://github.com/AlibabaDR/community/blob/master/CODE_OF_CONDUCT.md) ([中文版](https://github.com/AlibabaDR/community/blob/master/CODE_OF_CONDUCT_zh.md)). 6 | -------------------------------------------------------------------------------- /changes/v1.0.27.md: -------------------------------------------------------------------------------- 1 | # 1.0.27 2 | ## Changes 3 | All issues and pull requests are [here](https://github.com/alibaba/ilogtail/milestone/1). 4 | ### Features 5 | - [public] [both] [updated] optimize system_v2 IOCounter metrics 6 | - [public] [both] [updated] change kafka flusher partition strategy to hash key 7 | ### Fixed 8 | - [inner] [both] [fixed] fixed processor_regex not support `.*` regular expression. 9 | - [inner] [both] [fixed] `service_http_server`: unlink unix sock before listen. 10 | - [inner] [both] [fixed] `metric_meta_kubernetes`: remove global variables. 11 | ### Doc 12 | 13 | -------------------------------------------------------------------------------- /changes/v1.0.28.md: -------------------------------------------------------------------------------- 1 | # 1.0.28 2 | ## Changes 3 | All issues and pull requests are [here](https://github.com/alibaba/ilogtail/milestone/2). 4 | ### Features 5 | - [public] [linux] [added] `snmp`: support SNMP protocol 6 | - [public] [both] [added] filter instance properties for skywalking v3 plugin 7 | ### Fixed 8 | - [public] [both] [fixed] fix the paren span id is incorrect 9 | ### Doc 10 | ## Download 11 | | Arch| Platform| Region| Link| 12 | | ---- | ---- | ---- | ---- | 13 | |arm64|Linux|China|[link](http://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/1.0.28/aarch64/logtail-linux64.tar.gz)| 14 | |amd64|Linux|China|[link](http://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/1.0.28/x86_64/logtail-linux64.tar.gz) 15 | |arm64|Linux|US|[link](http://logtail-release-us-west-1.oss-us-west-1.aliyuncs.com/linux64/1.0.28/aarch64/logtail-linux64.tar.gz) 16 | |amd64|Linux|US|[link](http://logtail-release-us-west-1.oss-us-west-1.aliyuncs.com/linux64/1.0.28/x86_64/logtail-linux64.tar.gz) 17 | -------------------------------------------------------------------------------- /changes/v1.0.34.md: -------------------------------------------------------------------------------- 1 | # 1.0.34 2 | ## Changes 3 | All issues and pull requests are [here](https://github.com/alibaba/ilogtail/milestone/9). 4 | ### Features 5 | - [public] [both] [updated] add workload attribute of Pod meta in metric_meta_kubernetes 6 | ### Fixed 7 | - [public] [both] [fixed] fixed without k8s labels in CRI fetching. 8 | ### Doc 9 | ## Download 10 | | Arch| Platform| Region| Link| 11 | | ---- | ---- | ---- | ---- | 12 | |arm64|Linux|China|[link](https://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/1.0.34/aarch64/logtail-linux64.tar.gz)| 13 | |amd64|Linux|China|[link](https://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/linux64/1.0.34/x86_64/logtail-linux64.tar.gz) 14 | |arm64|Linux|US|[link](https://logtail-release-us-west-1.oss-us-west-1.aliyuncs.com/linux64/1.0.34/aarch64/logtail-linux64.tar.gz) 15 | |amd64|Linux|US|[link](https://logtail-release-us-west-1.oss-us-west-1.aliyuncs.com/linux64/1.0.34/x86_64/logtail-linux64.tar.gz) 16 | -------------------------------------------------------------------------------- /config_server/README.md: -------------------------------------------------------------------------------- 1 | # ConfigServer 2 | 3 | Please refer to the [ConfigServer](https://github.com/iLogtail/ConfigServer) code repository. -------------------------------------------------------------------------------- /config_server/protocol/README.md: -------------------------------------------------------------------------------- 1 | # 管控协议说明 2 | 3 | ConfigServer管控协议的总贴、V1版本协议说明和翻新至V2的讨论参见 4 | [服务端管控协议共建,欢迎参与讨论交流](https://github.com/alibaba/loongcollector/discussions/404)。 5 | 6 | V2版本的讨论参见 7 | [心跳&配置同步流程重构讨论](https://github.com/alibaba/loongcollector/discussions/1491#discussioncomment-9547735)。 8 | -------------------------------------------------------------------------------- /core/checkpoint/RangeCheckpoint.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "RangeCheckpoint.h" 16 | 17 | #include "CheckpointManagerV2.h" 18 | 19 | namespace logtail { 20 | 21 | void RangeCheckpoint::save() { 22 | static auto sCptM = CheckpointManagerV2::GetInstance(); 23 | data.set_update_time(time(NULL)); 24 | sCptM->SetPB(key, data); 25 | } 26 | 27 | } // namespace logtail 28 | -------------------------------------------------------------------------------- /core/collection_pipeline/queue/QueueKey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | using QueueKey = int64_t; 24 | 25 | } // namespace logtail 26 | -------------------------------------------------------------------------------- /core/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(common) 17 | 18 | if (LINUX) 19 | add_executable(BoostRegexValidator BoostRegexValidator.cpp) 20 | link_jsoncpp(BoostRegexValidator) 21 | link_boost(BoostRegexValidator) 22 | endif () 23 | -------------------------------------------------------------------------------- /core/common/CompressTools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace logtail { 24 | 25 | bool CompressLz4(const std::string& src, std::string& dst); 26 | bool CompressLz4(const char* srcPtr, const uint32_t srcSize, std::string& dest); 27 | 28 | } // namespace logtail 29 | -------------------------------------------------------------------------------- /core/common/CrashBackTraceUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | #include 19 | 20 | namespace logtail { 21 | 22 | void ResetCrashBackTrace(); 23 | std::string GetCrashBackTrace(); 24 | 25 | } // namespace logtail 26 | -------------------------------------------------------------------------------- /core/common/EncodingUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | std::string Base64Encode(const std::string& message); 24 | 25 | } // namespace logtail 26 | -------------------------------------------------------------------------------- /core/common/EnvUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _ENVUTIL_H_ 18 | #define _ENVUTIL_H_ 19 | 20 | namespace logtail { 21 | 22 | void SetEnv(const char* key, const char* value); 23 | void UnsetEnv(const char* key); 24 | 25 | } // namespace logtail 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /core/common/FeedbackInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | class FeedbackInterface { 24 | public: 25 | virtual ~FeedbackInterface() = default; 26 | 27 | virtual void Feedback(int64_t key) = 0; 28 | }; 29 | 30 | } // namespace logtail 31 | -------------------------------------------------------------------------------- /core/common/LogRunnable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _LOG_LOG_RUNNABLE_H__ 18 | #define _LOG_LOG_RUNNABLE_H__ 19 | 20 | namespace logtail { 21 | class LogRunnable { 22 | virtual void HoldOn() = 0; 23 | virtual void Resume() = 0; 24 | virtual void Start() {} 25 | virtual void Stop() {} 26 | }; 27 | } // namespace logtail 28 | 29 | #endif // _LOG_LOG_RUNNABLE_H__ 30 | -------------------------------------------------------------------------------- /core/common/ScopeInvoker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | #include 19 | 20 | namespace logtail { 21 | 22 | class ScopeInvoker { 23 | const std::function _f; 24 | 25 | public: 26 | explicit ScopeInvoker(std::function f) : _f(std::move(f)) {} 27 | 28 | ~ScopeInvoker() { _f(); } 29 | }; 30 | 31 | } // namespace logtail 32 | -------------------------------------------------------------------------------- /core/common/Span.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | #include "boost/core/span.hpp" 19 | 20 | namespace logtail { 21 | 22 | template 23 | using Span = boost::span; 24 | 25 | } // namespace logtail 26 | -------------------------------------------------------------------------------- /core/common/SplitedFilePath.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | -------------------------------------------------------------------------------- /core/common/Strptime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | namespace logtail { 20 | 21 | const char* strptime_ns(const char* buf, const char* fmt, struct tm* tm, long* nanosecond, int* nanosecondLength); 22 | 23 | } // namespace logtail 24 | -------------------------------------------------------------------------------- /core/common/UUIDUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | std::string CalculateRandomUUID(); 24 | 25 | } // namespace logtail 26 | -------------------------------------------------------------------------------- /core/common/Version.cpp.in: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | 3 | const char* const ILOGTAIL_VERSION = "@LOGTAIL_VERSION@"; 4 | const char* const ILOGTAIL_GIT_HASH = "@LOGTAIL_GIT_HASH@"; 5 | const char* const ILOGTAIL_BUILD_DATE = "@LOGTAIL_BUILD_DATE@"; 6 | 7 | #if defined(__linux__) 8 | const char* const ILOGTAIL_UPDATE_SUFFIX = ""; 9 | #elif defined(_MSC_VER) 10 | const char* const ILOGTAIL_UPDATE_SUFFIX = ".update"; 11 | #endif -------------------------------------------------------------------------------- /core/common/compression/CompressType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | namespace logtail { 20 | 21 | enum class CompressType { 22 | NONE, 23 | LZ4, 24 | ZSTD 25 | #ifdef APSARA_UNIT_TEST_MAIN 26 | , 27 | MOCK 28 | #endif 29 | }; 30 | 31 | } // namespace logtail 32 | -------------------------------------------------------------------------------- /core/common/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __ILOGTAIL_VERSION__ 18 | #define __ILOGTAIL_VERSION__ 19 | 20 | extern const char* const ILOGTAIL_VERSION; 21 | extern const char* const ILOGTAIL_UPDATE_SUFFIX; 22 | extern const char* const ILOGTAIL_GIT_HASH; 23 | extern const char* const ILOGTAIL_BUILD_DATE; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /core/ebpf/driver/Log.h: -------------------------------------------------------------------------------- 1 | // Copyright 2025 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #include 18 | 19 | #include "ebpf/include/export.h" 20 | 21 | void set_log_handler(logtail::ebpf::eBPFLogHandler log_fn); 22 | void ebpf_log(logtail::ebpf::eBPFLogType level, const char* format, ...); 23 | -------------------------------------------------------------------------------- /core/file_server/event_listener/EventListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #if defined(__linux__) 20 | #include "file_server/event_listener/EventListener_Linux.h" 21 | #elif defined(_MSC_VER) 22 | #include "file_server/event_listener/EventListener_Windows.h" 23 | #endif 24 | -------------------------------------------------------------------------------- /core/host_monitor/Constants.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "host_monitor/Constants.h" 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | std::filesystem::path PROCESS_DIR = "/proc"; 24 | const std::filesystem::path PROCESS_STAT = "stat"; 25 | const int64_t SYSTEM_HERTZ = sysconf(_SC_CLK_TCK); 26 | 27 | } // namespace logtail 28 | -------------------------------------------------------------------------------- /core/host_monitor/Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace logtail { 22 | 23 | extern std::filesystem::path PROCESS_DIR; 24 | const extern std::filesystem::path PROCESS_STAT; 25 | const extern int64_t SYSTEM_HERTZ; 26 | 27 | } // namespace logtail 28 | -------------------------------------------------------------------------------- /core/host_monitor/SystemInformationTools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | namespace logtail { 23 | 24 | bool GetHostSystemStat(std::vector& lines, std::string& errorMessage); 25 | 26 | } // namespace logtail 27 | -------------------------------------------------------------------------------- /core/plugin/flusher/links.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2024 iLogtail Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # This file is used to link external source files in flusher directory 16 | 17 | macro(flusher_link target_name) 18 | # link external libraries 19 | endmacro() -------------------------------------------------------------------------------- /core/plugin/input/links.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2024 iLogtail Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # This file is used to link external source files in input directory 16 | 17 | macro(input_link target_name) 18 | # link external libraries 19 | endmacro() 20 | -------------------------------------------------------------------------------- /core/prometheus/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include 5 | 6 | #include "common/StringView.h" 7 | #include "common/http/HttpResponse.h" 8 | 9 | namespace logtail { 10 | 11 | std::string URLEncode(const std::string& value); 12 | 13 | std::string SecondToDuration(uint64_t duration); 14 | uint64_t DurationToSecond(const std::string& duration); 15 | 16 | uint64_t SizeToByte(const std::string& size); 17 | 18 | bool IsValidMetric(const StringView& line); 19 | void SplitStringView(const std::string& s, char delimiter, std::vector& result); 20 | bool IsNumber(const std::string& str); 21 | 22 | uint64_t GetRandSleepMilliSec(const std::string& key, uint64_t intervalSeconds, uint64_t currentMilliSeconds); 23 | 24 | namespace prom { 25 | std::string NetworkCodeToState(NetworkCode code); 26 | std::string HttpCodeToState(uint64_t code); 27 | } // namespace prom 28 | 29 | } // namespace logtail 30 | -------------------------------------------------------------------------------- /core/prometheus/async/PromFuture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "common/Lock.h" 6 | 7 | namespace logtail { 8 | 9 | enum class PromFutureState { New, Processing, Done }; 10 | 11 | template 12 | class PromFuture { 13 | public: 14 | using CallbackSignature = std::function; 15 | // Process should support oneshot and streaming mode. 16 | bool Process(Args...); 17 | 18 | void AddDoneCallback(CallbackSignature&&); 19 | 20 | void Cancel(); 21 | 22 | protected: 23 | PromFutureState mState = {PromFutureState::New}; 24 | ReadWriteLock mStateRWLock; 25 | 26 | std::vector mDoneCallbacks; 27 | 28 | #ifdef APSARA_UNIT_TEST_MAIN 29 | friend class ScrapeSchedulerUnittest; 30 | #endif 31 | }; 32 | 33 | } // namespace logtail 34 | -------------------------------------------------------------------------------- /core/runner/InputRunner.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "runner/InputRunner.h" 16 | 17 | #include "collection_pipeline/CollectionPipelineManager.h" 18 | 19 | using namespace std; 20 | 21 | namespace logtail { 22 | 23 | InputRunner::InputRunner() { 24 | CollectionPipelineManager::GetInstance()->RegisterInputRunner(this); 25 | } 26 | 27 | } // namespace logtail 28 | -------------------------------------------------------------------------------- /core/runner/sink/SinkType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 iLogtail Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | namespace logtail { 20 | 21 | enum class SinkType { HTTP, NONE }; 22 | 23 | } // namespace logtail 24 | -------------------------------------------------------------------------------- /core/unittest/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(app_config_unittest) 17 | 18 | add_executable(app_config_unittest AppConfigUnittest.cpp) 19 | target_link_libraries(app_config_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(app_config_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/controller/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(controller_unittest) 17 | 18 | add_executable(event_dispatcher_dir_unittest EventDispatcherDirUnittest.cpp) 19 | target_link_libraries(event_dispatcher_dir_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(event_dispatcher_dir_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/instance_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(instance_config_unittest) 17 | 18 | add_executable(instance_config_manager_unittest InstanceConfigManagerUnittest.cpp) 19 | target_link_libraries(instance_config_manager_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(instance_config_manager_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/log_pb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(log_pb_unittest) 17 | 18 | add_executable(log_group_serializer_unittest LogGroupSerializerUnittest.cpp) 19 | target_link_libraries(log_group_serializer_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(log_group_serializer_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/logger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(logger_unittest) 17 | 18 | add_executable(logger_unittest logger_unittest.cpp) 19 | target_link_libraries(logger_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(logger_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/logger/logger_unittest.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "logger/Logger.h" 16 | 17 | #include 18 | 19 | int main() { 20 | logtail::Logger::Instance().InitGlobalLoggers(); 21 | std::cout << "Hello world" << std::endl; 22 | } 23 | -------------------------------------------------------------------------------- /core/unittest/loop_ut.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo %1 4 | for /l %%x in (1, 1, %1) do ( 5 | echo %%x 6 | call run_ut.bat 7 | ) -------------------------------------------------------------------------------- /core/unittest/loop_ut.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2022 iLogtail Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | for((i=0;i<$1;i++)) 18 | do 19 | ./run_ut.sh 20 | done -------------------------------------------------------------------------------- /core/unittest/metadata/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(metadata_unittest) 17 | 18 | add_executable(metadata_unittest K8sMetadataUnittest.cpp) 19 | target_link_libraries(metadata_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(metadata_unittest) -------------------------------------------------------------------------------- /core/unittest/provider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(provider_unittest) 17 | 18 | add_executable(provider_unittest ProviderUnittest.cpp) 19 | target_link_libraries(provider_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(provider_unittest) 23 | -------------------------------------------------------------------------------- /core/unittest/reader/testDataSet/ForceReadUnittest/utf8.txt: -------------------------------------------------------------------------------- 1 | iLogtail 为可观测场景而生,拥有的轻量级、高性能、自动化配置等诸多生产级别特性,在阿里巴巴以及外部数万家阿里云客户内部广泛应用。 2 | 你可以将它部署于物理机,虚拟机,Kubernetes等多种环境中来采集遥测数据,例如logs、traces和metrics。 3 | iLogtail 支持收集多种遥测数据并将其传输到多种不同的后端,例如 SLS 可观测平台。 -------------------------------------------------------------------------------- /core/unittest/reader/testDataSet/JsonLogFileReaderUnittest/gbk.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/core/unittest/reader/testDataSet/JsonLogFileReaderUnittest/gbk.txt -------------------------------------------------------------------------------- /core/unittest/reader/testDataSet/JsonLogFileReaderUnittest/utf8.txt: -------------------------------------------------------------------------------- 1 | {"first":"iLogtail 为可观测场景而生,拥有的轻量级、高性能、自动化配置等诸多生产级别特性,在阿里巴巴以及外部数万家阿里云客户内部广泛应用。"} 2 | {"second":"你可以将它部署于物理机,虚拟机,Kubernetes等多种环境中来采集遥测数据,例如logs、traces和metrics。", 3 | "third":"iLogtail 支持收集多种遥测数据并将其传输到多种不同的后端,例如 SLS 可观测平台。"} 4 | -------------------------------------------------------------------------------- /core/unittest/reader/testDataSet/LogFileReaderUnittest/gbk.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/core/unittest/reader/testDataSet/LogFileReaderUnittest/gbk.txt -------------------------------------------------------------------------------- /core/unittest/reader/testDataSet/LogFileReaderUnittest/utf8.txt: -------------------------------------------------------------------------------- 1 | iLogtail 为可观测场景而生,拥有的轻量级、高性能、自动化配置等诸多生产级别特性,在阿里巴巴以及外部数万家阿里云客户内部广泛应用。 2 | 你可以将它部署于物理机,虚拟机,Kubernetes等多种环境中来采集遥测数据,例如logs、traces和metrics。 3 | iLogtail 支持收集多种遥测数据并将其传输到多种不同的后端,例如 SLS 可观测平台。 4 | -------------------------------------------------------------------------------- /core/unittest/report_failure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2022 iLogtail Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | for log in `find ut.output -name "output.log" | sort` 18 | do 19 | echo "========= $log =========" 20 | cat $log | grep -A 6 Failure 21 | cat $log | grep -A 6 exception 22 | cat $log | grep -A 6 throw 23 | echo "========================" 24 | done 25 | -------------------------------------------------------------------------------- /core/unittest/sender/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | project(sender_unittest) 17 | 18 | add_executable(flusher_runner_unittest FlusherRunnerUnittest.cpp) 19 | target_link_libraries(flusher_runner_unittest ${UT_BASE_TARGET}) 20 | 21 | include(GoogleTest) 22 | gtest_discover_tests(flusher_runner_unittest) 23 | -------------------------------------------------------------------------------- /core/utils.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | macro(logtail_define varname docstring default) 16 | if ("${ARGC}" GREATER 4) 17 | message(FATAL_ERROR "logtail_define: Too many macro arguments") 18 | endif () 19 | if (NOT DEFINED "${varname}") 20 | set(${varname} "${default}") 21 | message(STATUS "Define ${varname} = ${default}") 22 | endif () 23 | endmacro() -------------------------------------------------------------------------------- /docker/Dockerfile.e2e-test: -------------------------------------------------------------------------------- 1 | FROM golang:1.19.10 2 | 3 | RUN mkdir -p /tmp/loongcollector 4 | 5 | WORKDIR /root 6 | COPY . ./loongcollector 7 | 8 | RUN apt-get update 9 | RUN apt-get -y install python3-setuptools 10 | RUN apt-get -y install python3-pip 11 | 12 | WORKDIR /root/loongcollector/test 13 | RUN pip3 install -r requirements.txt --break-system-packages 14 | 15 | CMD ["sh", "-c", "while true; do sleep 3600; done"] -------------------------------------------------------------------------------- /docker/Dockerfile_build: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/loongcollector-community-edition/loongcollector-build-linux:2.1.4 AS build 16 | 17 | USER root 18 | WORKDIR /src 19 | COPY . . 20 | 21 | ARG HOST_OS=Linux 22 | ARG VERSION=0.0.1 23 | 24 | RUN --mount=type=ssh sh generated_files/gen_build.sh 25 | -------------------------------------------------------------------------------- /docker/Dockerfile_goc: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # goc server is only for e2e test to analysis code coverage. 16 | 17 | FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/loongcollector-community-edition/loongcollector-build-linux:2.1.4 AS build 18 | 19 | USER root 20 | ENTRYPOINT ["goc","server"] 21 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfile 2 | 3 | ## Dockerfiles to build iLogtail 4 | 5 | Dockerfile_build: build iLogtail 6 | Dockerfile_goc: goc server 7 | Dockerfile_development_part: testing entrypoint 8 | Dockerfile_production: production entrypoint 9 | 10 | Dockerfile_development_part works with the e2e engine. For the usage, we add a ENV named HOST_OS to distinguish host system because the `host.docker.internal` host cannot be parsed in the docker engine of Linux, more details please see [here](https://github.com/docker/for-linux/issues/264). 11 | -------------------------------------------------------------------------------- /docs/cn/config-server/usage-instructions.md: -------------------------------------------------------------------------------- 1 | # 使用介绍 2 | 3 | ## 简介 4 | 5 | 目前开源版 LoongCollector 主要提供了本地采集配置管理模式,当涉及实例数较多时,需要逐个实例进行配置变更,管理比较复杂。 6 | 7 | 此外,多实例场景下 LoongCollector 的版本信息、运行状态等也缺乏统一的监控。因此,需要提供全局管控服务用于对 LoongCollector 的采集配置、版本信息、运行状态等进行统一的管理。 8 | 9 | ConfigServer 就是这样的一款管控工具,目前支持: 10 | 11 | * LoongCollector 注册到 ConfigServer 12 | * 以 Agent 组的形式对 LoongCollector 进行统一管理 13 | * 远程批量配置 LoongCollector 的采集配置 14 | * 监控 LoongCollector 的运行状态 15 | 16 | 代码库与使用方法参见[ConfigServer](https://github.com/iLogtail/ConfigServer)。 17 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/code-check/check-codestyle.md: -------------------------------------------------------------------------------- 1 | # 检查代码规范 2 | 3 | ## 检查Go代码规范 4 | 5 | LogtailPlugin 使用 [golangci-lint](https://golangci-lint.run/) 检查代码风格。 `SCOPE` 定义是 6 | 可选,默认范围是根目录。 7 | 8 | ```makefile 9 | SCOPE=xxx make lint 10 | ``` 11 | 12 | xxx为限定的目录名称。 13 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/code-check/check-license.md: -------------------------------------------------------------------------------- 1 | # 检查文件许可证 2 | 3 | LogtailPlugin 遵循标准的 Apache 2.0 许可,所有文件必须具有许可证声明。 所以贡献者应该检查贡献的文件是否拥有此许可证。 4 | 5 | ## 检查许可证 6 | 7 | 如果要检查整个项目文件,请运行以下命令。 没有许可证的文件将被找到并保存为 license_coverage.txt。 8 | 9 | ```makefile 10 | make check-license 11 | ``` 12 | 13 | 当需要固定范围时,请在命令中附加`SCOPE`。 14 | 15 | ```makefile 16 | SCOPE=xxx make check-license 17 | ``` 18 | 19 | xxx为限定的目录名称。 20 | 21 | ## 添加许可证 22 | 23 | 当某些带有许可证的文件建立后,您可以通过以下方式将许可证添加到文件中。 请注意,这种方式将修复所有缺少许可证的文件。 24 | 25 | ```makefile 26 | make license 27 | ``` 28 | 29 | 同上,如果你想限制变化范围,请在命令中附加`SCOPE`。 30 | 31 | ```makefile 32 | SCOPE=xxx make license 33 | ``` 34 | 35 | xxx为限定的目录名称。 36 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/data-model-cpp.md: -------------------------------------------------------------------------------- 1 | # 数据模型(C++) 2 | 3 | 【文档施工中,请耐心等待】 4 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/log-protocol/log-protocol.md: -------------------------------------------------------------------------------- 1 | # 日志协议 2 | 3 | LoongCollector 的日志数据默认以sls自定义协议的形式与外部进行交互,但也支持日志数据在sls协议和其它标准协议或自定义协议之间的转换。除此之外,对于某种协议,LoongCollector 还支持对日志数据进行不同方式的编码。 4 | 5 | 目前,LoongCollector 日志数据支持的协议及相应的编码方式如下表所示,其中协议类型可分为自定义协议和标准协议: 6 | 7 | | 协议类型 | 协议名称 | 支持的编码方式 | 8 | |-------|--------------------------------------------------------------------------------------------------|---------------| 9 | | 标准协议 | [sls协议](protocol-spec/sls.md) | json、protobuf | 10 | | 自定义协议 | [单条协议](protocol-spec/custom-single.md) | json | 11 | | 标准协议 | [Influxdb协议](https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_reference/) | custom | 12 | | 字节流协议 | [raw协议](protocol-spec/raw.md) | custom | 13 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/log-protocol/protocol-spec/custom-single.md: -------------------------------------------------------------------------------- 1 | # 单条协议 2 | 3 | 单条协议在内存中对应的数据结构为`map[string]interface{}`,其中的键及相应值的类型为: 4 | 5 | - time:`uint32`类型 6 | - contents:`map[string]string`类型 7 | - tags:`map[string]string`类型 8 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/log-protocol/protocol-spec/raw.md: -------------------------------------------------------------------------------- 1 | # raw协议 2 | 3 | raw协议在内存中对应的数据结构定义如下: 4 | 5 | ## ByteArray & GroupInfo 6 | 7 | 传输数据的原始字节流,是`PipelineEvent`的一种实现。 8 | 9 | ```go 10 | type ByteArray []byte 11 | ``` 12 | 13 | 传输数据的标签及元数据信息,简单的key/value对。 14 | 15 | ```go 16 | type GroupInfo struct { 17 | Metadata Metadata 18 | Tags Tags 19 | } 20 | ``` 21 | 22 | ## PipelineGroupEvents 23 | 24 | 传输数据整体。 25 | 26 | ```go 27 | type PipelineGroupEvents struct { 28 | Group *GroupInfo 29 | Events []PipelineEvent 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/plugin-development/extended-plugins/principles-of-plugin-configuration.md: -------------------------------------------------------------------------------- 1 | # 插件配置项基本原则 2 | 3 | ## 必选参数的处理原则 4 | 5 | 1. key 拼写错误:等价于该 key 没有被配置,直接拒绝加载该参数 6 | 2. value 格式错误、取值错误:直接拒绝加载该参数 7 | 8 | ## 可选参数的处理原则 9 | 10 | 1. key 拼写错误:等价于该 key 没有被配置,使用默认值 11 | 2. value 格式错误、取值错误:使用默认值 12 | 13 | ## 过滤类参数的处理原则 14 | 15 | ### 过滤类参数出现错误的处理原则 16 | 17 | #### 白名单 18 | 19 | 1. key 不存在或者 key 取值为空:不进行过滤 20 | 2. value 有值但全部取值错误:使用默认值,一般不进行过滤 21 | 3. value 有值且存在正确取值:使用正确取值作为白名单过滤参数 22 | 23 | #### 黑名单 24 | 25 | 1. key 不存在或者 key 取值为空:不进行过滤 26 | 2. value 有值但全部取值错误:使用默认值,一般不进行过滤 27 | 3. value 有值且存在正确取值:使用正确取值作为黑名单过滤参数 28 | 29 | ### 过滤类参数的内外部作用关系 30 | 31 | #### 白名单 32 | 33 | 1. 每一个列表过滤参数的内部:匹配到列表的每一个取值都被允许过滤通过,内部过滤条件之间是“或”的关系 34 | 2. 多个列表过滤参数之间:只有在所有列表参数中都被允许过滤通过的取值才会最终通过,多个列表过滤参数之间是“且”的关系 35 | 36 | #### 黑名单 37 | 38 | 1. 每一个列表过滤参数的内部:匹配到列表内的每一个取值都不允许被过滤通过,内部过滤条件之间是“或”的关系 39 | 2. 多个列表过滤参数之间:在每个列表参数中不被允许过滤通过的取值最终都不会通过,多个列表过滤参数之间是“或”的关系 40 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/self-monitor/alarms/internal-alarms-description.md: -------------------------------------------------------------------------------- 1 | # 自监控告警说明 2 | 3 | 【文档施工中,请耐心等待】 4 | -------------------------------------------------------------------------------- /docs/cn/developer-guide/self-monitor/metrics/how-to-add-internal-metrics.md: -------------------------------------------------------------------------------- 1 | # 如何添加自监控指标 2 | 3 | ## C++ 添加自监控指标 4 | 5 | 【文档施工中,请耐心等待】 6 | 7 | ## Golang 添加自监控指标 8 | 9 | 参见[Golang 自监控指标接口](../../plugin-development/plugin-debug/plugin-self-monitor-guide.md) -------------------------------------------------------------------------------- /docs/cn/events/summer-ospp-2024/projects/summer-ospp-2024-projects.md: -------------------------------------------------------------------------------- 1 | # iLogtail 社区项目介绍 2 | 3 | iLogtail 为本次开源之夏贡献了两个项目。宣传视频:[iLogtail 社区开源之夏宣讲介绍](https://www.bilibili.com/video/BV1JH4y1V7FS/?vd_source=b01dd5670462ce34eca76313ec727f4d) 4 | 5 | * [iLogtail 数据吞吐性能优化](summer-ospp-2024-projects-ilogtail-io.md) 6 | * [ConfigServer 能力升级 + 体验优化(全栈)](summer-ospp-2024-projects-config-server.md) 7 | -------------------------------------------------------------------------------- /docs/cn/events/summer-ospp-2024/summer-ospp-2024.md: -------------------------------------------------------------------------------- 1 | # 开源之夏 2024 2 | 3 | ## 活动介绍 4 | 5 | [开源之夏](https://summer-ospp.ac.cn/)是由中国科学院软件研究所“开源软件供应链点亮计划”发起并长期支持的一项暑期开源活动,旨在鼓励在校学生积极参与开源软件的开发维护,培养和发掘更多优秀的开发者,促进优秀开源软件社区的蓬勃发展,助力开源软件供应链建设。活动联合各大开源社区,针对重要开源软件的开发与维护提供项目开发任务,并向全球高校学生开放报名。 6 | 7 | 开源之夏活动中的 [iLogtail 社区主页](https://summer-ospp.ac.cn/org/orgdetail/6eba80a6-81a9-4999-8c3b-70796665f622?lang=zh)。 8 | 9 | ## 如何参与 10 | 11 | 欢迎 iLogtail 社区学生成员报名参加活动。 12 | 13 | 学生可自主选择感兴趣的项目进行申请,中选后在项目开发者(社区导师)的指导下进行开发。根据项目的难易程度和完成情况,结项者将获取开源之夏活动奖金和结项证书。 14 | 15 | 关于报名、项目选择的说明和建议,参见[学生指南](https://summer-ospp.ac.cn/help/student/)与[项目申请建议](https://summer-ospp.ac.cn/help/proj_apply/)。 16 | 17 | 下面是活动的部分日程安排,请有意愿参加的同学关注: 18 | 19 | * 04/30-06/04 学生报名、挑选项目、与导师沟通并准备项目申请材料、提交申请 20 | * 06/05-06/25 项目申请审核 21 | * 06/26 中选公示 22 | * 06/26-06/30 项目预热 23 | * 07/01-09/30 项目开发 24 | * 10/01-10/31 导师结项审核-PR/MR 合并阶段 25 | * 11/01-11/08 组委会结项审核-成果审核阶段 26 | * 11/09 结项项目公示 27 | * 11月 年度优秀学生评选 28 | -------------------------------------------------------------------------------- /docs/cn/installation/os.md: -------------------------------------------------------------------------------- 1 | # 支持的操作系统 2 | 3 | LoongCollector 支持以下操作系统和架构。 4 | 5 | | | | | 6 | | -------- | ------------------------------------- | ------- | 7 | | **操作系统** | **发行版** | **架构** | 8 | | Linux | Aliyun Linux 2 | x86\_64 | 9 | | | RedHat Enterprise 6、7、8 | x86\_64 | 10 | | | CentOS 6、7、8 | x86\_64 | 11 | | | CentOS Stream 8 | x86\_64 | 12 | | | Debian 8、9、10、11 | x86\_64 | 13 | | | Ubuntu 14.04、16.04、18.04、20.04 | x86\_64 | 14 | | | SUSE Linux Enterprise Server 11、12、15 | x86\_64 | 15 | | | OpenSUSE 15.1、15.2、42.3 | x86\_64 | 16 | | | 其他基于glibc 2.5及以上版本的Linux操作系统 | x86\_64 | 17 | -------------------------------------------------------------------------------- /docs/cn/installation/sources/docker-image.md: -------------------------------------------------------------------------------- 1 | # Docker镜像 2 | 3 | ## 制作前准备 4 | 5 | [下载源代码](download.md) 6 | 7 | [安装docker](https://docs.docker.com/engine/install/) 8 | 9 | ## 镜像制作 10 | 11 | 制作镜像分为2步: 12 | 13 | 1. 代码库根目录准备 loongcollector-\.\.tar.gz 14 | 若使用已发布版本,可以从[LoongCollector 发布记录](../release-notes/release-notes.md)下载压缩包。 15 | 若要使用本地最新代码构建,则执行如下命令`make dist`。 16 | 2. 将 LoongCollector 发行版的tar包安装到base镜像中。 17 | 执行命令`make docker`。 18 | 19 | 制作的镜像默认名称为aliyun/loongcollector ,可以DOCKER_REPOSITORY环境变量覆盖,Tag则必须与 LoongCollector 包的版本相同,可以通过环境变量VERSION指定,例如: 20 | 21 | ```shell 22 | $ VERSION=0.0.2 make dist 23 | $ VERSION=0.0.2 make docker 24 | $ docker image list 25 | REPOSITORY TAG IMAGE ID CREATED SIZE 26 | aliyun/loongcollector 0.0.2 c7977eb7dcc1 2 minutes ago 764MB 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/cn/installation/sources/download.md: -------------------------------------------------------------------------------- 1 | # 下载 2 | 3 | ## 稳定版本 4 | 5 | 生成环境,请从稳定版本源代码进行编译。稳定版本源代码的 tar 包下载链接地址服从如下规则: 6 | 7 | `https://loongcollector-community-edition.oss-cn-shanghai.aliyuncs.com//loongcollector-.-.tar.gz` 8 | 9 | 例如: 10 | 11 | `https://loongcollector-community-edition.oss-cn-shanghai.aliyuncs.com/0.2.0/loongcollector-0.2.0.linux-amd64.tar.gz` 12 | 13 | ## 开发版本 14 | 15 | 对于有兴趣测试最新版本或者乐于贡献代码到开发者,获取最新开发代码GIT仓库的命令为: 16 | 17 | ```bash 18 | git clone https://github.com/alibaba/loongcollector 19 | ``` 20 | 21 | 注意,main分支是 LoongCollector 的开发分支。因此,存在无法编译或者运行时出错的可能。 22 | 23 | 我们欢迎更多开发者参与测试或者开发,您的贡献将使 LoongCollector 更加出色。 24 | -------------------------------------------------------------------------------- /docs/cn/plugins/aggregator/aggregators.md: -------------------------------------------------------------------------------- 1 | # 聚合 2 | 3 | 聚合插件用于将事件进行打包,从而提升发送效率。仅限以下场景使用: 4 | 5 | * 使用了[SLS输出插件](../flusher/native/flusher-sls.md)以外的其他输出插件。 6 | 7 | * 使用了[SLS输出插件](../flusher/native/flusher-sls.md),且同时使用了[扩展处理插件](../processor/processors.md) 8 | 9 | 对于上述场景,如果用户的采集配置中未指定聚合插件,则`LoongCollector`会使用默认聚合插件,即[上下文聚合插件](aggregator-context.md)。 10 | -------------------------------------------------------------------------------- /docs/cn/plugins/extension/extensions.md: -------------------------------------------------------------------------------- 1 | # 扩展 2 | 3 | 扩展插件用于对其它插件能力的补充(e.g. 鉴权、编解码、熔断、限流……) -------------------------------------------------------------------------------- /docs/cn/plugins/flusher/flushers.md: -------------------------------------------------------------------------------- 1 | # 输出 2 | -------------------------------------------------------------------------------- /docs/cn/plugins/flusher/native/flusher-blackhole.md: -------------------------------------------------------------------------------- 1 | # SLS 2 | 3 | ## 简介 4 | 5 | `flusher_blackhole` `flusher`插件直接丢弃采集的事件,属于原生输出插件,主要用于测试。 6 | 7 | ## 版本 8 | 9 | [Stable](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:LoongCollector v3.0.5 及以上 14 | 15 | ## 配置参数 16 | 17 | | **参数** | **类型** | **是否必填** | **默认值** | **说明** | 18 | | --- | --- | --- | --- | --- | 19 | | Type | string | 是 | / | 插件类型。固定为flusher\_blackhole。 | 20 | 21 | ## 样例 22 | 23 | 采集`/home/test-log/`路径下的所有文件名匹配`*.log`规则的文件,并将采集结果丢弃。 24 | 25 | ``` yaml 26 | enable: true 27 | inputs: 28 | - Type: input_file 29 | FilePaths: 30 | - /home/test-log/*.log 31 | flushers: 32 | - Type: flusher_blackhole 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/cn/plugins/input/extended/metric-input-example.md: -------------------------------------------------------------------------------- 1 | # MetricInput示例插件 2 | 3 | ## 简介 4 | 5 | `metric_input_example` 可作为编写`MetricInput`类插件的参考示例样例,该插件会定时生成模拟的指标数据。[源代码](https://github.com/alibaba/loongcollector/blob/main/plugins/input/example/metric_example.go) 6 | 7 | ## 版本 8 | 9 | [Stable](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:iLogtail v1.0.27 及以上 14 | 15 | ## 配置参数 16 | 17 | | 参数 | 类型,默认值 | 说明 | 18 | | - | - | - | 19 | | Type | String,无默认值(必填) | 插件类型,固定为`metric_input_example`。 | 20 | 21 | ## 样例 22 | 23 | * 采集配置 24 | 25 | ```yaml 26 | enable: true 27 | inputs: 28 | - Type: metric_input_example 29 | flushers: 30 | - Type: flusher_stdout 31 | OnlyStdout: true 32 | ``` 33 | 34 | * 输出 35 | 36 | ```json 37 | 38 | { 39 | "__name__":"example_counter", 40 | "__labels__":"hostname#$#************************|ip#$#172.***.***.***", 41 | "__time_nano__":"1658491078378371632", 42 | "__value__":"101", 43 | "__time__":"1658491078" 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /docs/cn/plugins/input/extended/service-input-example.md: -------------------------------------------------------------------------------- 1 | # ServiceInput示例插件 2 | 3 | ## 简介 4 | 5 | `service_input_example` 可作为编写`ServiceInput`类插件的参考示例样例,可以在指定端口接收模拟HTTP请求。[源代码](https://github.com/alibaba/loongcollector/blob/main/plugins/input/example/service_example.go) 6 | 7 | ## 版本 8 | 9 | [Stable](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:iLogtail v1.0.27 及以上 14 | 15 | ## 配置参数 16 | 17 | | 参数 | 类型,默认值 | 说明 | 18 | | - | - | - | 19 | | Type | String,无默认值(必填) | 插件类型,固定为`service_input_example`。 | 20 | | Address | String,`:19000` | 接收端口。 | 21 | 22 | ## 样例 23 | 24 | * 采集配置 25 | 26 | ```yaml 27 | enable: true 28 | inputs: 29 | - Type: service_input_example 30 | flushers: 31 | - Type: flusher_stdout 32 | OnlyStdout: true 33 | ``` 34 | 35 | * 输入 36 | 37 | ```bash 38 | curl --header "test:val123" http://127.0.0.1:19000/data 39 | ``` 40 | 41 | * 输出 42 | 43 | ```json 44 | { 45 | "test":"val123", 46 | "__time__":"1658495321" 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/cn/plugins/input/native/input-host-meta.md: -------------------------------------------------------------------------------- 1 | # 主机元信息采集 2 | 3 | ## 简介 4 | 5 | `input_host_meta` 定时采集主机元数据,包括主机、进程及其之间的关系。 6 | 7 | ## 版本 8 | 9 | [Beta](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:【待发布】 14 | 15 | ## 配置参数 16 | 17 | | 参数 | 类型,默认值 | 说明 | 18 | | - | - | - | 19 | | Type | String,无默认值(必填) | 插件类型,固定为`input_host_meta`。 | 20 | | Interval | int, 60 | 采集间隔时间,单位为秒。 | 21 | 22 | ## 样例 23 | 24 | * 采集配置 25 | 26 | ```yaml 27 | enable: true 28 | inputs: 29 | - Type: input_host_meta 30 | flushers: 31 | - Type: flusher_stdout 32 | OnlyStdout: true 33 | ``` 34 | 35 | * 输出 36 | 37 | ```json 38 | { 39 | "__domain__":"infra", 40 | "__entity_type__":"infra.host.process", 41 | "__entity_id__":"8a1aee58dcdea68434e058e48e39f965", 42 | "__first_observed_time__":"1735348941", 43 | "__last_observed_time__":"1736163039", 44 | "__keep_alive_seconds__":"120", 45 | "pid":"84450", 46 | "ppid":"0", 47 | "comm":"sh", 48 | "ktime":"1735348941" 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /docs/cn/plugins/input/native/input-internal-alarms.md: -------------------------------------------------------------------------------- 1 | # 自监控告警数据 2 | 3 | ## 简介 4 | 5 | `input_internal_alarms` 插件收集 LoongCollector 自身运行时的告警数据,并以[LogEvent](../../../developer-guide/data-model-cpp.md)的格式暴露出去。 6 | 7 | ## 版本 8 | 9 | [Beta](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:LoongCollector v3.0.5 及以上 14 | 15 | ## 配置参数 16 | 17 | 关于具体告警的详情,请参见[自监控告警说明](../../../developer-guide/self-monitor/alarms/internal-alarms-description.md)。 18 | 19 | | **参数** | **类型** | **是否必填** | **默认值** | **说明** | 20 | | --- | --- | --- | --- | --- | 21 | | Type | string | 是 | / | 插件类型。固定为input\_internal\_alarms。 | 22 | 23 | ## 样例 24 | 25 | 采集LoongCollector所有自监控告警,并将采集结果写到本地文件。 26 | 27 | ``` yaml 28 | enable: true 29 | inputs: 30 | - Type: input_internal_alarms 31 | flushers: 32 | - Type: flusher_file 33 | FilePath: self_monitor/self_alarms.log 34 | ``` 35 | 36 | 输出到 LoongCollector 的 `self_monitor/self_alarms.log` 文件中,每行均为一条json格式的告警。 37 | -------------------------------------------------------------------------------- /docs/cn/plugins/input/native/input-process-security.md: -------------------------------------------------------------------------------- 1 | # input_process_security 插件 2 | 3 | ## 简介 4 | 5 | `input_process_security`插件可以实现利用ebpf探针采集进程安全相关动作。 6 | 7 | ## 版本 8 | 9 | [Dev](../../stability-level.md) 10 | 11 | ## 版本说明 12 | 13 | * 推荐版本:【待发布】 14 | 15 | ## 配置参数 16 | 17 | | **参数** | **类型** | **是否必填** | **默认值** | **说明** | 18 | | --- | --- | --- | --- | --- | 19 | | Type | string | 是 | / | 插件类型。固定为input\_process\_security | 20 | 21 | ## 样例 22 | 23 | ### XXXX 24 | 25 | * 输入 26 | 27 | ```json 28 | TODO 29 | ``` 30 | 31 | * 采集配置 32 | 33 | ```yaml 34 | enable: true 35 | inputs: 36 | - Type: input_process_security 37 | flushers: 38 | - Type: flusher_stdout 39 | OnlyStdout: true 40 | Tags: true 41 | ``` 42 | 43 | * 输出 44 | 45 | ```json 46 | TODO 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/cn/plugins/processor/extended/README.md: -------------------------------------------------------------------------------- 1 | # 扩展插件 2 | -------------------------------------------------------------------------------- /docs/cn/plugins/stability-level.md: -------------------------------------------------------------------------------- 1 | # 版本管理 2 | 3 | 由于不同的iLogtail插件往往处于不同的开发进度,为了更好地区分这些插件的状态及可用性,我们将所有插件的状态分为4个阶段:Alpha、Beta、Stable和Deprecated,用户可以在各个插件的说明页上看到该插件的状态,从而方便用户更好地进行方案选择。 4 | 5 | ## Alpha 6 | 7 | 任何初始PR提交的代码均处于该阶段。处于该阶段的插件已经初步具备使用条件,可在非关键场景中使用,但可能存在以下情况: 8 | 9 | 1. 插件的配置项仍可更改,且不保证后向兼容; 10 | 2. 插件可能存在功能错误和性能问题,用户可向社区反馈,但不一定得到立即响应。 11 | 12 | ## Beta 13 | 14 | 当一个处于Alpha阶段的插件已经在部分非关键场景中稳定运行一段时间后,该插件进入Beta阶段。处于该阶段的插件已经基本达到稳定使用的条件,但仍然可能存在以下情况: 15 | 16 | 1. 插件的配置项仍可微调,但保证后向兼容; 17 | 2. 插件仍然可能存在微小的功能错误和性能问题,用户向社区反馈后,插件维护者将会尽快响应。 18 | 19 | ## Stable 20 | 21 | 当处于Beta阶段的插件满足以下条件后,该插件正式进入稳定状态: 22 | 23 | 1. 该插件已被一定数量的社区用户在生产环境中使用,且运行稳定,无异常报告; 24 | 2. 该插件的功能已经完善,社区无新增相关issue,无未解决bug; 25 | 26 | ## Deprecated 27 | 28 | 当一个插件被标注为Deprecated后,该插件将在不久的版本中被移除,社区中与之相关的新增issue将不再响应,具体信息可以参见插件的文档说明。 29 | -------------------------------------------------------------------------------- /docs/en/README.md: -------------------------------------------------------------------------------- 1 | # Welcome 2 | 3 | **Here are iLogtail official documentations. You're welcome to join us.** 4 | 5 | From here you can learn all about **iLogtail's** architecture, how to deploy and use iLogtail. 6 | 7 | - [Concepts & Designs](concept&designs/README.md). Introduce the core data structures and designs of iLogtail. 8 | 9 | - [Setup](setup/README.md). Introduce how to set up iLogtail. 10 | 11 | - [Guides](guides/README.md). Guide users to develop or debug iLogtail. 12 | - [Plugins](plugins/plugin-list.md). The plugin configuration docs. 13 | 14 | We're always looking for help improve our documentation and codes, so please don’t hesitate to [file an issue](https://github.com/alibaba/ilogtail/issues/new) 15 | if you see any problem. 16 | Or better yet, submit your own contributions through pull request to help make them better. 17 | -------------------------------------------------------------------------------- /docs/en/concept&designs/README.md: -------------------------------------------------------------------------------- 1 | # Concepts and Designs 2 | 3 | Concepts and Designs help you to learn and understand the iLogtail. 4 | 5 | ## What is iLogtail? 6 | 7 | iLogtail is the collection part of the Simple Log Service a.k.a "SLS" in Alibaba Cloud. It is used to collect telemetry data, such as Logs, Traces, and Metrics. More details please see [here](https://www.alibabacloud.com/help/doc-detail/28979.htm). 8 | 9 | ## The Designs of iLogtail 10 | 11 | The following parts would show the inner structures of iLogtail, which is useful to help you understand iLogtail designs. 12 | 13 | - [Overview](Overview.md) 14 | - [Datastructure](Datastructure.md) 15 | -------------------------------------------------------------------------------- /docs/en/guides/How-to-chek-codestyle.md: -------------------------------------------------------------------------------- 1 | # How to check code style? 2 | 3 | LogtailPlugin use [golangci-lint](https://golangci-lint.run/) to check the code style. The `SCOPE` definition is 4 | optional, the default scope is root directory. 5 | 6 | ```makefile 7 | SCOPE=xxx make lint 8 | ``` 9 | -------------------------------------------------------------------------------- /docs/en/guides/How-to-release.md: -------------------------------------------------------------------------------- 1 | # How to release? 2 | 3 | 1. Please check whether `CHANGELOG.md` in root dir has unreleased contents. 4 | 2. Execute `sh scripts/gen_release_markdown.sh {version} {milestone-number}` commends to generate release markdown. And milestone-number cloud be found at [the link](https://github.com/alibaba/loongcollector/milestones), such as the milestone number of v1.0.28 is [2](https://github.com/alibaba/loongcollector/milestone/2). 5 | 3. Please check whether the file named `changes/{version}.md` has all unreleased contents. 6 | 4. Please check whether the download link in `changes/{version}.md` working well. If having broken links, please upload the release files. 7 | 5. Commit & Push Github. 8 | 6. Press the release button in the GitHub console and paste the content of `changes/{version}.md` to here. 9 | -------------------------------------------------------------------------------- /docs/en/plugins/metric_input/metric_input_netping.md: -------------------------------------------------------------------------------- 1 | # metric_input_netping 2 | 3 | ## Description 4 | 5 | a icmp-ping/tcp-ping plugin for logtail 6 | 7 | ## Config 8 | 9 | | field | type | description | default value | 10 | | ---- | ---- | ---- | ---- | 11 | |disable_dns_metric|bool|disable dns resolve metric, default is false| false| 12 | |timeout_seconds|int|the timeout of ping/tcping, unit is second,must large than or equal 1, less than 30, default is 5|5| 13 | |interval_seconds|int|the interval of ping/tcping, unit is second,must large than or equal 5, less than 86400 and timeout_seconds, default is 60|60| 14 | |icmp|[]netping.ICMPConfig|the icmping config list, example: {"src" : "${IP_ADDR}", "target" : "${REMOTE_HOST}", "count" : 3}|null| 15 | |tcp|[]netping.TCPConfig|the tcping config list, example: {"src" : "${IP_ADDR}", "target" : "${REMOTE_HOST}", "port" : ${PORT}, "count" : 3}|null| 16 | -------------------------------------------------------------------------------- /docs/en/plugins/plugin-list.md: -------------------------------------------------------------------------------- 1 | # Plugin List 2 | 3 | - aggregator 4 | - flusher 5 | - metric_input 6 | - [metric_input_netping](metric_input/metric_input_netping.md) 7 | - processor 8 | - [processor_gotime](processor/processor_gotime.md) 9 | - [processor_strptime](processor/processor_strptime.md) 10 | - [processor_fields_with_condition](processor/processor_fields_with_condition.md) 11 | - [processor_csv](processor/processor_csv.md) 12 | - service_input 13 | - [service_docker_stdout](service_input/service_docker_stdout.md) 14 | - [service_prometheus](service_input/service_prometheus.md) 15 | -------------------------------------------------------------------------------- /docs/en/plugins/service_input/service_prometheus.md: -------------------------------------------------------------------------------- 1 | # service_prometheus 2 | 3 | ## Description 4 | 5 | prometheus scrape plugin for logtail, use vmagent lib 6 | 7 | ## Config 8 | 9 | | field | type | description | default value | 10 | | ---- | ---- | ---- | ---- | 11 | |Yaml|string|the prometheus configuration content, more details please see [here](https://prometheus.io/docs/prometheus/latest/configuration/configuration/)|""| 12 | |ConfigFilePath|string|the prometheus configuration path, and the param would be ignored when Yaml param is configured.|""| 13 | |AuthorizationPath|string|the prometheus authorization path, only using in authorization files. When Yaml param is configured, the default value is the current binary path. However, the default value is the ConfigFilePath directory when ConfigFilePath is working.|""| 14 | -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/bind: -------------------------------------------------------------------------------- 1 | BIND9_TIMESTAMP %{MONTHDAY}[-]%{MONTH}[-]%{YEAR} %{TIME} 2 | 3 | BIND9 %{BIND9_TIMESTAMP:timestamp} queries: %{LOGLEVEL:loglevel}: client(:? @0x(?:[0-9A-Fa-f]+))? %{IP:clientip}#%{POSINT:clientport} \(%{GREEDYDATA:query}\): query: %{GREEDYDATA:query} IN %{GREEDYDATA:querytype} \(%{IP:dns}\) -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/maven: -------------------------------------------------------------------------------- 1 | MAVEN_VERSION (?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)(?:[.-](RELEASE|SNAPSHOT))? -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/mcollective: -------------------------------------------------------------------------------- 1 | MCOLLECTIVEAUDIT %{TIMESTAMP_ISO8601:timestamp}: -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/mcollective-patterns: -------------------------------------------------------------------------------- 1 | """Remember, these can be multi-line events.""" 2 | MCOLLECTIVE ., \[%{TIMESTAMP_ISO8601:timestamp} #%{POSINT:pid}\]%{SPACE}%{LOGLEVEL:event_level} 3 | 4 | MCOLLECTIVEAUDIT %{TIMESTAMP_ISO8601:timestamp}: -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/mongodb: -------------------------------------------------------------------------------- 1 | MONGO_LOG %{SYSLOGTIMESTAMP:timestamp} \[%{WORD:component}\] %{GREEDYDATA:message} 2 | MONGO_QUERY \{ (?<={ ).*(?= } ntoreturn:) \} 3 | MONGO_SLOWQUERY %{WORD} %{MONGO_WORDDASH:database}\.%{MONGO_WORDDASH:collection} %{WORD}: %{MONGO_QUERY:query} %{WORD}:%{NONNEGINT:ntoreturn} %{WORD}:%{NONNEGINT:ntoskip} %{WORD}:%{NONNEGINT:nscanned}.*nreturned:%{NONNEGINT:nreturned}..+ (?[0-9]+)ms 4 | MONGO_WORDDASH \b[\w-]+\b 5 | MONGO3_SEVERITY \w 6 | MONGO3_COMPONENT %{WORD}|- 7 | MONGO3_LOG %{TIMESTAMP_ISO8601:timestamp} %{MONGO3_SEVERITY:severity} %{MONGO3_COMPONENT:component}%{SPACE}(?:\[%{DATA:context}\])? %{GREEDYDATA:message} -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/postgresql: -------------------------------------------------------------------------------- 1 | """Default postgresql pg_log format pattern""" 2 | POSTGRESQL %{DATESTAMP:timestamp} %{TZ} %{DATA:user_id} %{GREEDYDATA:connection_id} %{POSINT:pid} -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/rails: -------------------------------------------------------------------------------- 1 | RUUID \h{32} 2 | """rails controller with action""" 3 | RCONTROLLER (?[^#]+)#(?\w+) 4 | 5 | """this will often be the only line:""" 6 | RAILS3HEAD (?m)Started %{WORD:verb} "%{URIPATHPARAM:request}" for %{IPORHOST:clientip} at (?%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND} %{ISO8601_TIMEZONE}) 7 | """for some a strange reason, params are stripped of {} - not sure that's a good idea.""" 8 | RPROCESSING \W*Processing by %{RCONTROLLER} as (?\S+)(?:\W*Parameters: {%{DATA:params}}\W*)? 9 | RAILS3FOOT Completed %{NUMBER:response}%{DATA} in %{NUMBER:totalms}ms %{RAILS3PROFILE}%{GREEDYDATA} 10 | RAILS3PROFILE (?:\(Views: %{NUMBER:viewms}ms \| ActiveRecord: %{NUMBER:activerecordms}ms|\(ActiveRecord: %{NUMBER:activerecordms}ms)? 11 | 12 | """putting it all together""" 13 | RAILS3 %{RAILS3HEAD}(?:%{RPROCESSING})?(?(?:%{DATA}\n)*)(?:%{RAILS3FOOT})? -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/redis: -------------------------------------------------------------------------------- 1 | REDISTIMESTAMP %{MONTHDAY} %{MONTH} %{TIME} 2 | REDISLOG \[%{POSINT:pid}\] %{REDISTIMESTAMP:timestamp} \* 3 | REDISMONLOG %{NUMBER:timestamp} \[%{INT:database} %{IP:client}:%{NUMBER:port}\] "%{WORD:command}"\s?%{GREEDYDATA:params} -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/ruby: -------------------------------------------------------------------------------- 1 | RUBY_LOGLEVEL (?:DEBUG|FATAL|ERROR|WARN|INFO) 2 | RUBY_LOGGER [DFEWI], \[%{TIMESTAMP_ISO8601:timestamp} #%{POSINT:pid}\] *%{RUBY_LOGLEVEL:loglevel} -- +%{DATA:progname}: %{GREEDYDATA:message} -------------------------------------------------------------------------------- /example_config/processor_grok_patterns/squid: -------------------------------------------------------------------------------- 1 | """Pattern squid3""" 2 | """Documentation of squid3 logs formats can be found at the following link: http://wiki.squid-cache.org/Features/LogFormat""" 3 | SQUID3 %{NUMBER:timestamp}\s+%{NUMBER:duration}\s%{IP:client_address}\s%{WORD:cache_result}/%{NONNEGINT:status_code}\s%{NUMBER:bytes}\s%{WORD:request_method}\s%{NOTSPACE:url}\s(%{NOTSPACE:user}|-)\s%{WORD:hierarchy_code}/(%{IPORHOST:server}|-)\s%{NOTSPACE:content_type} -------------------------------------------------------------------------------- /example_config/quick_start/config/file_simple.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | enable: true 16 | inputs: 17 | - Type: input_file 18 | FilePaths: 19 | - /home/test-log/*.log 20 | flushers: 21 | - Type: flusher_stdout # 标准输出流输出类型 22 | OnlyStdout: true 23 | -------------------------------------------------------------------------------- /example_config/quick_start/loongcollector_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_access_key_id": "", 3 | "default_access_key": "" 4 | } 5 | -------------------------------------------------------------------------------- /example_config/start_with_docker/config/file_simple.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | enable: true 16 | inputs: 17 | - Type: input_file 18 | FilePaths: 19 | - /home/test-log/*.log 20 | EnableContainerDiscovery: true 21 | flushers: 22 | - Type: flusher_stdout 23 | OnlyStdout: true -------------------------------------------------------------------------------- /example_config/start_with_docker/config/stdout_simple.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | enable: true 16 | inputs: 17 | - Type: service_docker_stdout # 容器标准输出流输入类型 18 | Stderr: false # 不采集标准错误流 19 | Stdout: true # 采集标准输出流 20 | flushers: 21 | - Type: flusher_stdout # 标准输出流输出类型 22 | FileName: simple.stdout # 重定向文件名 -------------------------------------------------------------------------------- /example_config/start_with_docker/loongcollector_config.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /example_config/start_with_k8s/loongcollector-ns.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 loongcollector Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | kind: Namespace 17 | metadata: 18 | name: loongcollector 19 | -------------------------------------------------------------------------------- /example_config/start_with_k8s/loongcollector-secret.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 loongcollector Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | kind: Secret 17 | metadata: 18 | name: loongcollector-secret 19 | namespace: loongcollector 20 | type: Opaque 21 | data: 22 | access_key_id: # accesskey id if you want to flush to SLS 23 | access_key: # accesskey secret if you want to flush to SLS -------------------------------------------------------------------------------- /external/README.md: -------------------------------------------------------------------------------- 1 | # Why do we need override some source codes? 2 | 3 | 1. Some package codes cannot compile on windows 386 because of Go const, more details please see the following docs. 4 | 1. https://github.com/go-mysql-org/go-mysql/issues/314 5 | 2. https://github.com/golang/go/issues/19621#issuecomment-287858122 6 | 2. The C files of some package cannot be included by Go vendor. 7 | 3. Some package is too heavy, we want to reduce the dependency packages. 8 | -------------------------------------------------------------------------------- /external/github.com/aliyun/alibaba-cloud-sdk-go/services/sls_inner/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/alibaba/ilogtail/internal/sls_inner 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /external/github.com/elastic/beats/v7/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/elastic/beats/v7 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /external/github.com/elastic/beats/v7/winlogbeat/sys/wineventlog/testdata/application-windows-error-reporting.evtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/external/github.com/elastic/beats/v7/winlogbeat/sys/wineventlog/testdata/application-windows-error-reporting.evtx -------------------------------------------------------------------------------- /external/github.com/elastic/beats/v7/winlogbeat/sys/wineventlog/testdata/sysmon-9.01.evtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/external/github.com/elastic/beats/v7/winlogbeat/sys/wineventlog/testdata/sysmon-9.01.evtx -------------------------------------------------------------------------------- /external/github.com/jeromer/syslogparser/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | -------------------------------------------------------------------------------- /external/github.com/jeromer/syslogparser/Makefile: -------------------------------------------------------------------------------- 1 | SUBPACKAGES=. rfc3164 rfc5424 2 | help: 3 | @echo "Available targets:" 4 | @echo "- tests: run tests" 5 | @echo "- installdependencies: installs dependencies declared in dependencies.txt" 6 | @echo "- clean: cleans directory" 7 | @echo "- benchmarks: run benchmarks" 8 | 9 | installdependencies: 10 | @cat dependencies.txt | xargs go get 11 | 12 | tests: installdependencies 13 | @for pkg in $(SUBPACKAGES); do cd $$pkg && go test -i && go test ; cd -;done 14 | 15 | clean: 16 | find . -type 'f' -name '*.test' -print | xargs rm -f 17 | 18 | benchmarks: 19 | @for pkg in $(SUBPACKAGES); do cd $$pkg && go test -gocheck.b ; cd -;done 20 | -------------------------------------------------------------------------------- /external/github.com/jeromer/syslogparser/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jeromer/syslogparser 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /external/github.com/jeromer/syslogparser/rfc3164/example_test.go: -------------------------------------------------------------------------------- 1 | package rfc3164_test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jeromer/syslogparser/rfc3164" 6 | ) 7 | 8 | func ExampleNewParser() { 9 | b := "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8" 10 | buff := []byte(b) 11 | 12 | p := rfc3164.NewParser(buff) 13 | err := p.Parse() 14 | if err != nil { 15 | panic(err) 16 | } 17 | 18 | fmt.Println(p.Dump()) 19 | } 20 | -------------------------------------------------------------------------------- /k8s_templates/README.md: -------------------------------------------------------------------------------- 1 | # The K8s Templates Directory 2 | 3 | ## About 4 | 5 | This folder contains out-of-box example configuration templates for iLogtail K8s deployment. It highlights the usage of common input and flusher plugins in the K8s environment. 6 | 7 | Please feel free to add one if it doesn't cover your case. 8 | 9 | ## 贡献指南 10 | 11 | `k8s_templates`目录包含完整的K8s部署案例,从源到典型处理到输出,以input / flusher插件进行划分。模版以`k8s---to-.yaml`命名,其中``代表ilogtail的不同部署模式,可选值为`daemonset`和`sidecar`,命名典型示例如`k8s-daemonset-stdout-to-sls.yaml`,`k8s-daemonset-file-to-kafka.yaml`。 12 | 13 | 模版内注释需要说明清楚适用场景和应用前需要替换的部分。 14 | 15 | 原则上模版应经量全面精简正交,便于用户理解后查找,自由组合。source为主的模版除 `input_file` 和 `service_docker_stdout` 插件具备kafka和sls 2个flusher外,其余都统一使用 `flusher_sls` 作为flusher。flusher为主的模版除 `flusher_kafka` 和 `flusher_sls` 外,应只选用1个配合最佳的插件作为input(容器场景通常是 `service_docker_stdout` ),避免意义不大的重复建设。 16 | 17 | 提交模版时,Issue / PR 请打上标签`example config`。 18 | -------------------------------------------------------------------------------- /licenses/LICENSE-beats: -------------------------------------------------------------------------------- 1 | Source code in this repository is variously licensed under the Apache License 2 | Version 2.0, an Apache compatible license, or the Elastic License. Outside of 3 | the "x-pack" folder, source code in a given file is licensed under the Apache 4 | License Version 2.0, unless otherwise noted at the beginning of the file or a 5 | LICENSE file present in the directory subtree declares a separate license. 6 | Within the "x-pack" folder, source code in a given file is licensed under the 7 | Elastic License, unless otherwise noted at the beginning of the file or a 8 | LICENSE file present in the directory subtree declares a separate license. 9 | 10 | The build produces two sets of binaries - one set that falls under the Elastic 11 | License and another set that falls under Apache License Version 2.0. The 12 | binaries that contain `-oss` in the artifact name are licensed under the Apache 13 | License Version 2.0. -------------------------------------------------------------------------------- /licenses/LICENSE-journalbeat: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Marcus Heese 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /licenses/LICENSE-murmurhash3: -------------------------------------------------------------------------------- 1 | SMHasher is a test suite designed to test the distribution, collision, and performance properties of non-cryptographic hash functions. 2 | This is the home for the MurmurHash family of hash functions along with the SMHasher test suite used to verify them. SMHasher is released under the MIT license. All MurmurHash versions are public domain software, and the author disclaims all copyright to their code. 3 | -------------------------------------------------------------------------------- /pkg/constraints/constraints.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package constraints 16 | 17 | type IntUintFloat interface { 18 | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 19 | } 20 | -------------------------------------------------------------------------------- /pkg/helper/containercenter/process_helper_others.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !linux 16 | // +build !linux 17 | 18 | package containercenter 19 | 20 | func ContainerProcessAlive(pid int) bool { 21 | return true 22 | } 23 | -------------------------------------------------------------------------------- /pkg/helper/k8smeta/k8s_meta_store_interface.go: -------------------------------------------------------------------------------- 1 | package k8smeta 2 | 3 | import ( 4 | "context" 5 | "runtime" 6 | 7 | "github.com/alibaba/ilogtail/pkg/logger" 8 | ) 9 | 10 | //revive:disable:exported 11 | type K8sMetaEvent struct { 12 | //revive:enable:exported 13 | EventType string 14 | Object *ObjectWrapper 15 | } 16 | 17 | type ObjectWrapper struct { 18 | ResourceType string 19 | Raw interface{} 20 | FirstObservedTime int64 21 | LastObservedTime int64 22 | Deleted bool 23 | } 24 | 25 | type IdxFunc func(obj interface{}) ([]string, error) 26 | 27 | type SendFunc func(events []*K8sMetaEvent) 28 | 29 | func panicRecover() { 30 | if err := recover(); err != nil { 31 | trace := make([]byte, 2048) 32 | runtime.Stack(trace, true) 33 | logger.Error(context.Background(), "PLUGIN_RUNTIME_ALARM", "k8s meta panic error", err, "stack", string(trace)) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pkg/helper/k8smeta/label_matcher.go: -------------------------------------------------------------------------------- 1 | package k8smeta 2 | 3 | import "k8s.io/apimachinery/pkg/labels" 4 | 5 | type labelMatcher struct { 6 | obj interface{} 7 | selector labels.Selector 8 | } 9 | 10 | type labelMatchers []*labelMatcher 11 | 12 | // newLabelMatcher create a new label matcher. 13 | func newLabelMatcher(obj interface{}, selector labels.Selector) *labelMatcher { 14 | return &labelMatcher{ 15 | obj, selector, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pkg/helper/net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package helper 16 | 17 | import ( 18 | "net" 19 | ) 20 | 21 | func GetFreePort() (port int, err error) { 22 | listener, err := net.Listen("tcp", ":0") //nolint:gosec 23 | if err != nil { 24 | return 0, err 25 | } 26 | defer listener.Close() 27 | return listener.Addr().(*net.TCPAddr).Port, nil 28 | } 29 | -------------------------------------------------------------------------------- /pkg/helper/path_helper_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package helper 16 | 17 | import ( 18 | "github.com/stretchr/testify/require" 19 | 20 | "strings" 21 | "testing" 22 | ) 23 | 24 | func TestGetFileListByPrefix(t *testing.T) { 25 | files, err := GetFileListByPrefix(".", "mount", false, 0) 26 | require.NoError(t, err) 27 | println(strings.Join(files, ",")) 28 | } 29 | -------------------------------------------------------------------------------- /pkg/helper/profile/pyroscope/jfr/testdata/example.jfr.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/helper/profile/pyroscope/jfr/testdata/example.jfr.gz -------------------------------------------------------------------------------- /pkg/helper/profile/pyroscope/jfr/testdata/example_parsed.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/helper/profile/pyroscope/jfr/testdata/example_parsed.json.gz -------------------------------------------------------------------------------- /pkg/helper/profile/pyroscope/jfr/testdata/jfr.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/helper/profile/pyroscope/jfr/testdata/jfr.raw -------------------------------------------------------------------------------- /pkg/helper/profile/pyroscope/jfr/testdata/jfr_labels.raw: -------------------------------------------------------------------------------- 1 | 2 | 3 |  4 |  5 | 6 |  7 |  8 | 9 |  10 |  11 | 12 |  13 |  14 | 15 |  16 |  17 | 18 |  19 |  20 | 21 |  22 |  23 | 24 |  25 | pool-2-thread-8pool-2-thread-7 thread_namepool-2-thread-2pool-2-thread-1pool-2-thread-6 pool-2-thread-5pool-2-thread-4pool-2-thread-3 -------------------------------------------------------------------------------- /pkg/helper/profile/pyroscope/pprof/testdata/cpu.pb.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/helper/profile/pyroscope/pprof/testdata/cpu.pb.gz -------------------------------------------------------------------------------- /pkg/helper/slice_helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package helper 16 | 17 | func ReverseStringSlice(s []string) { 18 | for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { 19 | s[i], s[j] = s[j], s[i] 20 | } 21 | } 22 | 23 | func ReverseBytesSlice(s [][]byte) { 24 | for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { 25 | s[i], s[j] = s[j], s[i] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pkg/helper/slice_helper_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package helper 16 | 17 | import ( 18 | "testing" 19 | 20 | "github.com/stretchr/testify/require" 21 | ) 22 | 23 | func TestReverseStringSlice(t *testing.T) { 24 | ss := []string{"a", "b"} 25 | ReverseStringSlice(ss) 26 | require.Equal(t, ss, []string{"b", "a"}) 27 | } 28 | -------------------------------------------------------------------------------- /pkg/logger/test/test_logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package test 16 | 17 | import "github.com/alibaba/ilogtail/pkg/logger" 18 | 19 | func init() { 20 | logger.InitTestLogger() 21 | } 22 | -------------------------------------------------------------------------------- /pkg/logtail/GoPluginAdapter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/logtail/GoPluginAdapter.dll -------------------------------------------------------------------------------- /pkg/logtail/libGoPluginAdapter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/logtail/libGoPluginAdapter.so -------------------------------------------------------------------------------- /pkg/pipeline/extensions/authenticator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package extensions 16 | 17 | // ClientAuthenticator allow adding auth or signature info to HTTP client request 18 | type ClientAuthenticator interface { 19 | RequestInterceptor 20 | } 21 | -------------------------------------------------------------------------------- /pkg/pipeline/extensions/extension_helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package extensions 16 | 17 | type ExtensionConfig struct { 18 | Type string 19 | Options map[string]interface{} 20 | } 21 | -------------------------------------------------------------------------------- /pkg/pipeline/extensions/flush_interceptor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package extensions 16 | 17 | import "github.com/alibaba/ilogtail/pkg/models" 18 | 19 | type FlushInterceptor interface { 20 | Intercept(group *models.PipelineGroupEvents) *models.PipelineGroupEvents 21 | } 22 | -------------------------------------------------------------------------------- /pkg/pipeline/pipeline.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package pipeline 16 | 17 | // PipelineContext which may include 18 | // collector interface、checkpoint interface、config read and many more.. 19 | type PipelineContext interface { //nolint 20 | Collector() PipelineCollector 21 | } 22 | -------------------------------------------------------------------------------- /pkg/protocol/decoder/pyroscope/test/dump_pprof_mem_data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/pkg/protocol/decoder/pyroscope/test/dump_pprof_mem_data -------------------------------------------------------------------------------- /pkg/protocol/encoder/common/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package common 16 | 17 | const ( 18 | ProtocolPrometheus = "prometheus" 19 | ) 20 | -------------------------------------------------------------------------------- /pkg/protocol/proto/README.md: -------------------------------------------------------------------------------- 1 | # How to generate pb 2 | 3 | cd ~ 4 | wget https://ghproxy.com/https://github.com/gogo/protobuf/archive/refs/tags/v1.3.2.tar.gz 5 | tar xzf v1.3.2.tar.gz 6 | mkdir -p ${GOPATH}/src/github.com/gogo 7 | mv protobuf-1.3.2 ${GOPATH}/src/github.com/gogo/protobuf 8 | 9 | cd ~ 10 | wget https://ghproxy.com/https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip 11 | unzip protoc-3.14.0-linux-x86_64.zip 12 | mv bin/protoc /usr/local/bin/ 13 | mv include/google/ /usr/local/include/ 14 | 15 | go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest 16 | 17 | bash pkg/protocol/proto/genernate.sh 18 | -------------------------------------------------------------------------------- /pkg/protocol/proto/genernate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROTO_HOME=$(cd $(dirname "$0"); pwd) 4 | PROTO_GEN_HOME=$PROTO_HOME/gen 5 | if [ -d "${PROTO_GEN_HOME}" ]; then 6 | rm -rf "${PROTO_GEN_HOME}" 7 | fi 8 | mkdir "${PROTO_GEN_HOME}" 9 | export PATH=$PATH:$GOPATH/bin 10 | 11 | protoc -I="${PROTO_HOME}" \ 12 | -I="${GOPATH}/src" \ 13 | --gogofaster_out=plugins=grpc:"${PROTO_GEN_HOME}" "${PROTO_HOME}"/*.proto 14 | -------------------------------------------------------------------------------- /pkg/protocol/proto/sls_logs_transfer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package sls_logs; 3 | 4 | import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 5 | 6 | option (gogoproto.marshaler_all) = true; 7 | option (gogoproto.unmarshaler_all) = true; 8 | option go_package = "github.com/alibaba/ilogtail/pkg/protocol"; 9 | 10 | import "sls_logs.proto"; 11 | 12 | // Report collected logs to the backend 13 | service LogReportService { 14 | rpc collect (stream LogGroup) returns (Response) { 15 | } 16 | } 17 | 18 | message Response { 19 | required ResponseCode code = 1; 20 | required string message = 2; 21 | } 22 | 23 | enum ResponseCode { 24 | Success = 0; 25 | Failure = 1; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /pkg/signals/signal_posix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | /* 5 | Copyright 2017 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package signals 21 | 22 | import ( 23 | "os" 24 | "syscall" 25 | ) 26 | 27 | var shutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM} 28 | -------------------------------------------------------------------------------- /pkg/signals/signal_windows.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package signals 18 | 19 | import ( 20 | "os" 21 | ) 22 | 23 | var shutdownSignals = []os.Signal{os.Interrupt} 24 | -------------------------------------------------------------------------------- /pkg/util/LogtailAlarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package util 16 | 17 | const ( 18 | InputCollectAlarm = "INPUT_COLLECT_ALARM" 19 | CategoryConfigAlarm = "CATEGORY_CONFIG_ALARM" 20 | ) 21 | -------------------------------------------------------------------------------- /plugin_main/wrapmemcpy/wrap_memcpy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build linux 16 | // +build linux 17 | 18 | package wrapmemcpy 19 | 20 | // #include "wrap_memcpy.h" 21 | import "C" 22 | -------------------------------------------------------------------------------- /plugin_main/wrapmemcpy/wrap_memcpy_others.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !linux 16 | // +build !linux 17 | 18 | package wrapmemcpy 19 | -------------------------------------------------------------------------------- /plugins/aggregator/aggregator_default.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package aggregator 16 | 17 | import ( 18 | "github.com/alibaba/ilogtail/pkg/pipeline" 19 | "github.com/alibaba/ilogtail/plugins/aggregator/context" 20 | ) 21 | 22 | func init() { 23 | pipeline.Aggregators["aggregator_default"] = func() pipeline.Aggregator { 24 | return context.NewAggregatorContext() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugins/all/init.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package all 16 | 17 | // this file here is a placeholder of the `all` package 18 | // plugin imports will be generated by the plugins.yaml 19 | -------------------------------------------------------------------------------- /plugins/flusher/prometheus/config.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package prometheus 16 | 17 | type config struct { 18 | // RemoteURL to request 19 | Endpoint string `validate:"required,http_url" json:"Endpoint"` 20 | // Max size of timeseries slice for prometheus remote write request, default is 1000 21 | SeriesLimit int `validate:"number" json:"SeriesLimit,omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /plugins/input/example/metric_example_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : [ 3 | { 4 | "type" : "metric_input_example", 5 | "detail" : { 6 | 7 | } 8 | } 9 | ], 10 | "flushers" : [ 11 | { 12 | "type" : "flusher_stdout", 13 | "detail" : { 14 | "OnlyStdout": true 15 | } 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /plugins/input/example/service_example_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : [ 3 | { 4 | "type" : "service_input_example", 5 | "detail" : { 6 | 7 | } 8 | } 9 | ], 10 | "flushers" : [ 11 | { 12 | "type" : "flusher_stdout", 13 | "detail" : { 14 | "OnlyStdout": true 15 | } 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /plugins/input/input_wineventlog/eventlog/common/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | Thank elastic for these codes. 17 | Copy from github.com/beats/libbeat/common. 18 | Git: commit b48d073b84e874a182c122d8ef2bad867f714a11 (HEAD, tag: v6.5.2) 19 | */ 20 | package common 21 | -------------------------------------------------------------------------------- /plugins/input/input_wineventlog/eventlog/doc.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package eventlog 5 | 6 | // Refer to Winlogbeat 6.5.2. 7 | // 8 | // Licensed to Elasticsearch B.V. under one or more contributor 9 | // license agreements. See the NOTICE file distributed with 10 | // this work for additional information regarding copyright 11 | // ownership. Elasticsearch B.V. licenses this file to you under 12 | // the Apache License, Version 2.0 (the "License"); you may 13 | // not use this file except in compliance with the License. 14 | // You may obtain a copy of the License at 15 | // 16 | // http://www.apache.org/licenses/LICENSE-2.0 17 | // 18 | // Unless required by applicable law or agreed to in writing, 19 | // software distributed under the License is distributed on an 20 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21 | // KIND, either express or implied. See the License for the 22 | // specific language governing permissions and limitations 23 | // under the License. 24 | -------------------------------------------------------------------------------- /plugins/input/kubernetesmetav2/meta_collector_batch_test.go: -------------------------------------------------------------------------------- 1 | package kubernetesmetav2 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | batch "k8s.io/api/batch/v1" //nolint:typecheck 8 | 9 | "github.com/alibaba/ilogtail/pkg/helper/k8smeta" 10 | ) 11 | 12 | func TestProcessEmptyJob(t *testing.T) { 13 | data := k8smeta.ObjectWrapper{ 14 | Raw: &batch.Job{}, 15 | } 16 | collector := &metaCollector{ 17 | serviceK8sMeta: &ServiceK8sMeta{ 18 | Interval: 10, 19 | }, 20 | } 21 | events := collector.processJobEntity(&data, "Update") 22 | assert.NotNil(t, events) 23 | assert.Len(t, events, 1) 24 | } 25 | 26 | func TestProcessEmptyCronJob(t *testing.T) { 27 | data := k8smeta.ObjectWrapper{ 28 | Raw: &batch.CronJob{}, 29 | } 30 | collector := &metaCollector{ 31 | serviceK8sMeta: &ServiceK8sMeta{ 32 | Interval: 10, 33 | }, 34 | } 35 | events := collector.processCronJobEntity(&data, "Update") 36 | assert.NotNil(t, events) 37 | assert.Len(t, events, 1) 38 | } 39 | -------------------------------------------------------------------------------- /plugins/input/kubernetesmetav2/meta_collector_networking_test.go: -------------------------------------------------------------------------------- 1 | package kubernetesmetav2 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | networking "k8s.io/api/networking/v1" //nolint:typecheck 8 | 9 | "github.com/alibaba/ilogtail/pkg/helper/k8smeta" 10 | ) 11 | 12 | func TestProcessEmptyIngress(t *testing.T) { 13 | data := k8smeta.ObjectWrapper{ 14 | Raw: &networking.Ingress{}, 15 | } 16 | collector := &metaCollector{ 17 | serviceK8sMeta: &ServiceK8sMeta{ 18 | Interval: 10, 19 | }, 20 | } 21 | events := collector.processIngressEntity(&data, "Update") 22 | assert.NotNil(t, events) 23 | assert.Len(t, events, 1) 24 | } 25 | -------------------------------------------------------------------------------- /plugins/input/kubernetesmetav2/meta_collector_storage_test.go: -------------------------------------------------------------------------------- 1 | package kubernetesmetav2 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | storage "k8s.io/api/storage/v1" //nolint:typecheck 8 | 9 | "github.com/alibaba/ilogtail/pkg/helper/k8smeta" 10 | ) 11 | 12 | func TestProcessEmptyStorageClass(t *testing.T) { 13 | data := k8smeta.ObjectWrapper{ 14 | Raw: &storage.StorageClass{}, 15 | } 16 | collector := &metaCollector{ 17 | serviceK8sMeta: &ServiceK8sMeta{ 18 | Interval: 10, 19 | }, 20 | } 21 | events := collector.processStorageClassEntity(&data, "Update") 22 | assert.NotNil(t, events) 23 | assert.Len(t, events, 1) 24 | } 25 | -------------------------------------------------------------------------------- /plugins/input/netping/netping.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : [ 3 | { 4 | "type" : "metric_input_netping", 5 | "detail" : { 6 | "interval_seconds" : 30, 7 | "icmp" : [ 8 | {"src" : "127.0.0.1", "target" : "www.baidu.com", "count" : 3}, 9 | {"src" : "127.0.0.1", "target" : "www.baidu.com", "count" : 3} 10 | ], 11 | "tcp" : [ 12 | {"src" : "127.0.0.1", "target" : "www.baidu.com", "port" : 80, "count" : 3} 13 | ] 14 | } 15 | } 16 | ], 17 | "flushers" : [ 18 | { 19 | "type" : "flusher_stdout", 20 | "detail" : { 21 | "OnlyStdout": true 22 | } 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /plugins/input/plugin_name.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package input 16 | 17 | const ServiceDockerStdoutPluginName = "service_docker_stdout" 18 | 19 | const MetricDocierFilePluginName = "metric_container_info" 20 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv2/proto/README.md: -------------------------------------------------------------------------------- 1 | # Apache SkyWalking data collect protocol 2 | Apache SkyWalking can collect data from different sources. Each kind of source should follow the protocols in this repo. 3 | 4 | ## License 5 | Apache 2.0 6 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/id_analyze.go.bak: -------------------------------------------------------------------------------- 1 | package input_skywalking_agent_v3 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | const ( 10 | ServiceIdParserSplit = "." 11 | ServiceIdConnector = "." 12 | ) 13 | 14 | type ServiceIdDefinition struct { 15 | Name string 16 | IsReal bool 17 | } 18 | 19 | type InstanceIdDefinition struct { 20 | ServiceId string 21 | name string 22 | } 23 | 24 | func AnalyzeServiceId(id string) (*ServiceIdDefinition, error) { 25 | parsed := strings.Split(id, ServiceIdParserSplit) 26 | if len(parsed) != 2 { 27 | return nil, fmt.Errorf("can't split service id into 2 parts, %s", id) 28 | } 29 | isReal, _ := strconv.ParseBool(parsed[1]) 30 | return &ServiceIdDefinition{ 31 | Name: parsed[0], 32 | IsReal: isReal, 33 | }, nil 34 | } 35 | 36 | func BuildServiceId(serviceName string, nodeType NodeType) string { 37 | return "" 38 | } -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/proto/.bazelrc: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | try-import %workspace%/user.bazelrc 19 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/proto/.gitignore: -------------------------------------------------------------------------------- 1 | # Bazel artifacts 2 | /bazel-bin 3 | /bazel-out 4 | /bazel-skywalking-data-collect-protocol 5 | /bazel-testlogs 6 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/proto/README.md: -------------------------------------------------------------------------------- 1 | # Apache SkyWalking data collect protocol 2 | 3 | Apache SkyWalking typically collect data from 4 | 5 | 1. Traces 6 | 2. Metrics(Meter system) 7 | 3. Logs 8 | 4. Command data. Push the commands to the agents from Server. 9 | 5. Event. 10 | 11 | This repo hosts the protocol of SkyWalking native report protocol, defined in gRPC. Read [Protocol DOC](https://github.com/apache/skywalking/blob/master/docs/en/protocols/README.md#probe-protocols) for more details 12 | 13 | ## Release 14 | 15 | This repo wouldn't release separately. All source codes have been included in the main repo release. The tags match the [main repo](https://github.com/apache/skywalking) tags. 16 | 17 | ## License 18 | 19 | Apache 2.0 20 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/proto/bazel/BUILD: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | -------------------------------------------------------------------------------- /plugins/input/skywalkingv3/testdata/meter_singlevalue.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Time": 1234567890, 4 | "Contents": [ 5 | { 6 | "Key": "__name__", 7 | "Value": "i_am_singleValue_metric" 8 | }, 9 | { 10 | "Key": "__time_nano__", 11 | "Value": "1234567890000000000" 12 | }, 13 | { 14 | "Key": "__labels__", 15 | "Value": "Hahaha#$#test|a#$#aaa|ip#$#1.2.3.4|service#$#service_111|serviceInstance#$#instance_222" 16 | }, 17 | { 18 | "Key": "__value__", 19 | "Value": "123" 20 | } 21 | ], 22 | "Time_ns": 0 23 | } 24 | ] -------------------------------------------------------------------------------- /plugins/input/telegraf/local_test/telegraf_test.conf: -------------------------------------------------------------------------------- 1 | [agent] 2 | logfile = "telegraf.log" 3 | logfile_rotation_max_size = 1024000 4 | logfile_rotation_max_archives = 2 5 | 6 | [[inputs.mem]] 7 | 8 | [[outputs.influxdb]] 9 | -------------------------------------------------------------------------------- /plugins/processor/addfields/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs": [ 3 | { 4 | "type": "metric_mock", 5 | "detail": { 6 | "Fields": { 7 | "1111": "2222" 8 | } 9 | } 10 | } 11 | ], 12 | "processors": [ 13 | { 14 | "type": "processor_add_fields", 15 | "detail": { 16 | "Fields": { 17 | "aaa2": "value2", 18 | "aaa3": "value3" 19 | } 20 | } 21 | } 22 | ], 23 | "flushers": [ 24 | { 25 | "type": "flusher_stdout", 26 | "detail": { 27 | "OnlyStdout": true 28 | } 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /plugins/processor/csv/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs":[ 3 | { 4 | "type":"metric_debug_file", 5 | "detail":{ 6 | "inputFilePath":"example.csv" 7 | } 8 | } 9 | ], 10 | "processors":[ 11 | { 12 | "type":"processor_split_log_string", 13 | "detail":{ 14 | "SplitSep":"\n", 15 | "SplitKey":"content" 16 | } 17 | }, 18 | { 19 | "type":"processor_csv", 20 | "detail":{ 21 | "SrcKey":"content", 22 | "DstKeys":["f1", "f2", "f3"], 23 | "PreserveOthers":true, 24 | "ExpandOthers":false, 25 | "TrimLeadingSpace":false 26 | } 27 | } 28 | ], 29 | "flushers":[ 30 | { 31 | "type":"flusher_stdout", 32 | "detail":{ 33 | "FileName":"example.out" 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /plugins/processor/dictmap/testfile.csv: -------------------------------------------------------------------------------- 1 | "127.0.0.1","LocalHost-LocalHost" 2 | "192.168.0.1","default login" -------------------------------------------------------------------------------- /plugins/processor/geoip/geoip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 iLogtail Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package geoip 16 | -------------------------------------------------------------------------------- /protobuf_public/models/log_event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package logtail.models; 3 | 4 | message LogEvent { 5 | uint64 Timestamp = 1; 6 | message Content { 7 | bytes Key = 1; 8 | bytes Value = 2; 9 | } 10 | repeated Content Contents= 2; 11 | bytes Level = 3; 12 | uint64 FileOffset = 4; 13 | uint64 RawSize = 5; 14 | } 15 | -------------------------------------------------------------------------------- /protobuf_public/models/metric_event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package logtail.models; 3 | 4 | message UntypedSingleValue { 5 | double Value = 1; 6 | } 7 | 8 | message MetricEvent { 9 | uint64 Timestamp = 1; 10 | bytes Name = 2; 11 | map Tags = 3; 12 | oneof Value { 13 | UntypedSingleValue UntypedSingleValue = 4; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /protobuf_public/models/pipeline_event_group.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package logtail.models; 3 | 4 | import "log_event.proto"; 5 | import "metric_event.proto"; 6 | import "span_event.proto"; 7 | 8 | message PipelineEventGroup { 9 | map Metadata = 1; 10 | map Tags = 2; 11 | message LogEvents { 12 | repeated LogEvent Events = 1; 13 | } 14 | message MetricEvents { 15 | repeated MetricEvent Events = 1; 16 | } 17 | message SpanEvents { 18 | repeated SpanEvent Events = 1; 19 | } 20 | oneof PipelineEvents { 21 | LogEvents Logs = 3; 22 | MetricEvents Metrics = 4; 23 | SpanEvents Spans = 5; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_filebeat/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to blackhole filebeat 3 | Performance file to blackhole filebeat 4 | 5 | @e2e-performance @docker-compose @filebeat-blackhole 6 | Scenario: PerformanceFileToBlackholeFilebeat 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_blackhole_filebeat} 10 | When start monitor {filebeat}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_blackhole_filebeat/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_filebeat/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | filebeat: 5 | image: docker.elastic.co/beats/filebeat:8.17.4 6 | user: root 7 | volumes: 8 | - ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro 9 | - .:/home/filebeat 10 | command: filebeat -e --strict.perms=false 11 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_filebeat/filebeat.yml: -------------------------------------------------------------------------------- 1 | filebeat.inputs: 2 | - type: filestream 3 | id: input-file 4 | paths: 5 | - /home/filebeat/*.log 6 | prospector.scanner.check_interval: 1s 7 | 8 | processors: 9 | - dissect: 10 | tokenizer: '%{ip} %{ident} %{auth} [%{timestamp}] "%{method} %{request} HTTP/%{http_version}" %{response_code} %{bytes} "%{referrer}" "%{user_agent}"' 11 | field: "message" 12 | target_prefix: "parsed" 13 | - drop_event: 14 | when: 15 | not: 16 | equals: 17 | parsed.user_agent: "no-agent" 18 | 19 | output.console: 20 | pretty: true 21 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_fluentbit/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to blackhole fluentbit 3 | Performance file to blackhole fluentbit 4 | 5 | @e2e-performance @docker-compose @fluentbit-blackhole 6 | Scenario: PerformanceFileToBlackholeFluentbit 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_blackhole_fluentbit} 10 | When start monitor {fluent-bit}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_blackhole_fluentbit/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_fluentbit/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | 5 | fluent-bit: 6 | image: cr.fluentbit.io/fluent/fluent-bit:4.0.0 7 | command: ["-c", "/tmp/main.conf"] 8 | volumes: 9 | - ./main.conf:/tmp/main.conf 10 | - ./parsers.conf:/tmp/parsers.conf 11 | - .:/home/fluentbit 12 | restart: always 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_fluentbit/main.conf: -------------------------------------------------------------------------------- 1 | [SERVICE] 2 | parsers_file /tmp/parsers.conf 3 | 4 | [INPUT] 5 | name tail 6 | path /home/fluentbit/*.log 7 | parser nginx 8 | db /tmp/tail.db 9 | refresh_interval 1 10 | read_from_head true 11 | 12 | [FILTER] 13 | name grep 14 | match * 15 | regex user_agent no-agent 16 | 17 | [OUTPUT] 18 | name stdout 19 | match * 20 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_fluentbit/parsers.conf: -------------------------------------------------------------------------------- 1 | [PARSER] 2 | Name nginx 3 | Format regex 4 | Regex ^(?[^ ]*) (?[^ ]*) (?[^ ]*) \[(?[^\]]*)\] "(?\S+)(?: +(?[^\"]*?)(?: +\S*)?)?" (?[^ ]*) (?[^ ]*)(?: "(?[^\"]*)" "(?[^\"]*)") -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_loongcollector/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to blackhole LoongCollector 3 | Performance file to blackhole LoongCollector 4 | 5 | @e2e-performance @docker-compose @loongcollector-blackhole 6 | Scenario: PerformanceFileToBlackholeiLoongCollector 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_blackhole_loongcollector} 10 | When start monitor {LoongCollector}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_blackhole_loongcollector/a.log} 12 | When wait monitor until log processing finished -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_loongcollector/loongcollector.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: input_file 4 | FilePaths: 5 | - /home/loongcollector/*.log 6 | processors: 7 | - Type: processor_parse_regex_native 8 | SourceKey: content 9 | Regex: ^([^ ]*) ([^ ]*) ([^ ]*) \[([^\]]*)\] "(\S+) ([^\"]*) (\S*)" ([^ ]*) ([^ ]*) "([^\"]*)" "([^\"]*)" 10 | Keys: 11 | - ip 12 | - ident 13 | - auth 14 | - timestamp 15 | - method 16 | - request 17 | - http_version 18 | - response_code 19 | - bytes 20 | - referrer 21 | - user_agent 22 | - Type: processor_filter_regex_native 23 | FilterKey: 24 | - user_agent 25 | FilterRegex: 26 | - ^no-agent$ 27 | flushers: 28 | - Type: flusher_blackhole -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_loongcollectorspl/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to blackhole LoongCollector-SPL 3 | Performance file to blackhole LoongCollector-SPL 4 | 5 | @e2e-performance @docker-compose @loongcollector-spl-blackhole 6 | Scenario: PerformanceFileToBlackholeLoongCollectorSPL 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_blackhole_loongcollectorspl} 10 | When start monitor {LoongCollectorSPL}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_blackhole_loongcollectorspl/a.log} 12 | When wait monitor until log processing finished -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_loongcollectorspl/loongcollector.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: input_file 4 | FilePaths: 5 | - /home/loongcollector/*.log 6 | processors: 7 | - Type: processor_spl 8 | Script: | 9 | * | parse-regexp content, '^([^ ]*) ([^ ]*) ([^ ]*) \[([^\]]*)\] "(\S+) ([^\"]*) (\S*)" ([^ ]*) ([^ ]*) "([^\"]*)" "([^\"]*)"' as ip, ident, auth, timestamp, method, request, http_version, response_code, bytes, referrer, user_agent 10 | | where user_agent='no-agent' 11 | flushers: 12 | - Type: flusher_blackhole 13 | 14 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_vector/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to blackhole vector 3 | Performance file to blackhole vector 4 | 5 | @e2e-performance @docker-compose @vector-blackhole 6 | Scenario: PerformanceFileToBlackholeVector 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_blackhole_vector} 10 | When start monitor {vector}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_blackhole_vector/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_vector/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | vector: 5 | image: timberio/vector:0.45.0-debian 6 | volumes: 7 | - ./vector.yaml:/etc/vector/vector.yaml 8 | - .:/home/vector-log 9 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_blackhole_vector/vector.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | input_file: 3 | type: file 4 | include: 5 | - /home/vector-log/*.log 6 | 7 | transforms: 8 | transform_regex: 9 | type: remap 10 | inputs: 11 | - input_file 12 | source: |- 13 | . = parse_regex!(.message, r'^(?P[^ ]*) (?P[^ ]*) (?P[^ ]*) \[(?P[^\]]*)\] "(?P\S+)(?: +(?P[^\"]*?)(?: +\S*)?)?" (?P[^ ]*) (?P[^ ]*)(?: "(?P[^\"]*)" "(?P[^\"]*)")') 14 | filter_agent: 15 | type: filter 16 | inputs: 17 | - transform_regex 18 | condition: 19 | type: "vrl" 20 | source: ."user_agent" == "no-agent" 21 | 22 | sinks: 23 | output_std: 24 | type: console 25 | inputs: 26 | - filter_agent 27 | encoding: 28 | codec: json -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_filebeat/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file filebeat 3 | Performance file to file filebeat 4 | 5 | @e2e-performance @docker-compose @filebeat-file 6 | Scenario: PerformanceFileToFileFilebeat 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_filebeat} 10 | When start monitor {filebeat}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_filebeat/a.log} 12 | When wait monitor until log processing finished -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_filebeat/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | filebeat: 5 | image: docker.elastic.co/beats/filebeat:8.17.4 6 | user: root 7 | volumes: 8 | - ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro 9 | - .:/home/filebeat 10 | command: filebeat -e --strict.perms=false -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_filebeat/filebeat.yml: -------------------------------------------------------------------------------- 1 | filebeat.inputs: 2 | - type: filestream 3 | id: input-file 4 | paths: 5 | - /home/filebeat/*.log 6 | prospector.scanner.check_interval: 1s 7 | 8 | processors: 9 | - dissect: 10 | tokenizer: '%{ip} %{ident} %{auth} [%{timestamp}] "%{method} %{request} HTTP/%{http_version}" %{response_code} %{bytes} "%{referrer}" "%{user_agent}"' 11 | field: "message" 12 | target_prefix: "parsed" 13 | 14 | output.file: 15 | path: /home/filebeat 16 | filename: test.out 17 | rotate_every_kb: 10240 18 | number_of_files: 10 -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_fluentbit/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file fluentbit 3 | Performance file to file fluentbit 4 | 5 | @e2e-performance @docker-compose @fluentbit-file 6 | Scenario: PerformanceFileToFileFluentbit 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_fluentbit} 10 | When start monitor {fluent-bit}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_fluentbit/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_fluentbit/clear_files.sh: -------------------------------------------------------------------------------- 1 | # 定义最大文件大小 2 | MAX_SIZE=$((5 * 1024 * 1024)) 3 | 4 | # 持续运行的循环 5 | while true; do 6 | # 查找匹配 /home/*/test.out 的文件 7 | for file in $(find /home -type f -name "test.out"); do 8 | # 获取文件大小 9 | filesize=$(stat -c "%s" "$file") 10 | 11 | # 如果文件大小超过限制,则清空文件 12 | if [ "$filesize" -gt "$MAX_SIZE" ]; then 13 | echo "Clearing file: $file (Size: $filesize bytes)" 14 | > "$file" # 清空文件内容 15 | fi 16 | done 17 | 18 | # 每秒检查一次 19 | sleep 1 20 | done -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_fluentbit/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | 5 | fluent-bit: 6 | image: cr.fluentbit.io/fluent/fluent-bit:4.0.0 7 | command: ["-c", "/tmp/main.conf"] 8 | volumes: 9 | - ./main.conf:/tmp/main.conf 10 | - ./parsers.conf:/tmp/parsers.conf 11 | - .:/home/fluentbit 12 | restart: always 13 | 14 | cleanup: 15 | image: alpine:latest 16 | command: > 17 | sh -c "chmod +x /home/fluentbit/clear_files.sh && 18 | /home/fluentbit/clear_files.sh" 19 | volumes: 20 | - .:/home/fluentbit 21 | - ./clear_files.sh:/home/fluentbit/clear_files.sh 22 | depends_on: 23 | - fluent-bit 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_fluentbit/main.conf: -------------------------------------------------------------------------------- 1 | [SERVICE] 2 | parsers_file /tmp/parsers.conf 3 | 4 | [INPUT] 5 | name tail 6 | path /home/fluentbit/*.log 7 | parser nginx 8 | refresh_interval 1 9 | read_from_head true 10 | db /tmp/tail.db 11 | 12 | [OUTPUT] 13 | name file 14 | match * 15 | path /home/fluentbit 16 | file test.out 17 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_fluentbit/parsers.conf: -------------------------------------------------------------------------------- 1 | [PARSER] 2 | Name nginx 3 | Format regex 4 | Regex ^(?[^ ]*) (?[^ ]*) (?[^ ]*) \[(?[^\]]*)\] "(?\S+)(?: +(?[^\"]*?)(?: +\S*)?)?" (?[^ ]*) (?[^ ]*)(?: "(?[^\"]*)" "(?[^\"]*)") -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollector/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file LoongCollector 3 | Performance file to file LoongCollector 4 | 5 | @e2e-performance @docker-compose @loongcollector-file 6 | Scenario: PerformanceFileToFileLoongCollector 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_loongcollector} 10 | When start monitor {LoongCollector}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_loongcollector/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollector/loongcollector.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: input_file 4 | FilePaths: 5 | - /home/loongcollector/*.log 6 | processors: 7 | - Type: processor_parse_regex_native 8 | SourceKey: content 9 | Regex: ^([^ ]*) ([^ ]*) ([^ ]*) \[([^\]]*)\] "(\S+) ([^\"]*) (\S*)" ([^ ]*) ([^ ]*) "([^\"]*)" "([^\"]*)" 10 | Keys: 11 | - ip 12 | - ident 13 | - auth 14 | - timestamp 15 | - method 16 | - request 17 | - http_version 18 | - response_code 19 | - bytes 20 | - referrer 21 | - user_agent 22 | flushers: 23 | - Type: flusher_file 24 | FilePath: /home/loongcollector/test.out -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollectorcgo/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file LoongCollector-CGo 3 | Performance file to file LoongCollector-CGo 4 | 5 | @e2e-performance @docker-compose @loongcollector-cgo-file 6 | Scenario: PerformanceFileToFileLoongCollectorCGo 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_loongcollectorcgo} 10 | When start monitor {LoongCollectorCGo}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_loongcollectorcgo/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollectorcgo/loongcollector.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: input_file 4 | FilePaths: 5 | - /home/loongcollector/*.log 6 | processors: 7 | - Type: processor_regex 8 | SourceKey: content 9 | Regex: ^([^ ]*) ([^ ]*) ([^ ]*) \[([^\]]*)\] "(\S+) ([^\"]*) (\S*)" ([^ ]*) ([^ ]*) "([^\"]*)" "([^\"]*)" 10 | Keys: 11 | - ip 12 | - ident 13 | - auth 14 | - timestamp 15 | - method 16 | - request 17 | - http_version 18 | - response_code 19 | - bytes 20 | - referrer 21 | - user_agent 22 | - Type: processor_filter_regex 23 | Include: 24 | user_agent: ^no-agent$ 25 | flushers: 26 | - Type: flusher_stdout 27 | OnlyStdout: false 28 | FileName: /home/loongcollector/test.out 29 | MaxSize: 10485760 -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollectorspl/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file LoongCollector-SPL 3 | Performance file to file LoongCollector-SPL 4 | 5 | @e2e-performance @docker-compose @loongcollector-spl-file 6 | Scenario: PerformanceFileToFileLoongCollectorSPL 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_loongcollectorspl} 10 | When start monitor {LoongCollectorSPL}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_loongcollectorspl/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_loongcollectorspl/loongcollector.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: input_file 4 | FilePaths: 5 | - /home/loongcollector/*.log 6 | processors: 7 | - Type: processor_spl 8 | Script: | 9 | * | parse-regexp content, '^([^ ]*) ([^ ]*) ([^ ]*) \[([^\]]*)\] "(\S+) ([^\"]*) (\S*)" ([^ ]*) ([^ ]*) "([^\"]*)" "([^\"]*)"' as ip, ident, auth, timestamp, method, request, http_version, response_code, bytes, referrer, user_agent 10 | flushers: 11 | - Type: flusher_file 12 | FilePath: /home/loongcollector/test.out 13 | 14 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_vector/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: performance file to file vector 3 | Performance file to file vector 4 | 5 | @e2e-performance @docker-compose @vector-file 6 | Scenario: PerformanceFileToFileVector 7 | Given {docker-compose} environment 8 | Given docker-compose boot type {benchmark} 9 | When start docker-compose {performance_file_to_file_vector} 10 | When start monitor {vector}, with timeout {6} min 11 | When generate random nginx logs to file, speed {10}MB/s, total {5}min, to file {./test_cases/performance_file_to_file_vector/a.log} 12 | When wait monitor until log processing finished 13 | -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_vector/clear_files.sh: -------------------------------------------------------------------------------- 1 | # 定义最大文件大小 2 | MAX_SIZE=$((5 * 1024 * 1024)) 3 | 4 | # 持续运行的循环 5 | while true; do 6 | # 查找匹配 /home/*/test.out 的文件 7 | for file in $(find /home -type f -name "test.out"); do 8 | # 获取文件大小 9 | filesize=$(stat -c "%s" "$file") 10 | 11 | # 如果文件大小超过限制,则清空文件 12 | if [ "$filesize" -gt "$MAX_SIZE" ]; then 13 | echo "Clearing file: $file (Size: $filesize bytes)" 14 | > "$file" # 清空文件内容 15 | fi 16 | done 17 | 18 | # 每秒检查一次 19 | sleep 1 20 | done -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_vector/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | vector: 5 | image: timberio/vector:0.45.0-debian 6 | volumes: 7 | - ./vector.yaml:/etc/vector/vector.yaml 8 | - .:/home/vector-log 9 | 10 | cleanup: 11 | image: alpine:latest 12 | command: > 13 | sh -c "chmod +x /home/vector-log/clear_files.sh && 14 | /home/vector-log/clear_files.sh" 15 | volumes: 16 | - .:/home/vector-log 17 | - ./clear_files.sh:/home/vector-log/clear_files.sh 18 | depends_on: 19 | - vector -------------------------------------------------------------------------------- /test/benchmark/test_cases/performance_file_to_file_vector/vector.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | input_file: 3 | type: file 4 | include: 5 | - /home/vector-log/*.log 6 | 7 | transforms: 8 | transform_regex: 9 | type: remap 10 | inputs: 11 | - input_file 12 | source: |- 13 | . = parse_regex!(.message, r'^(?P[^ ]*) (?P[^ ]*) (?P[^ ]*) \[(?P[^\]]*)\] "(?P\S+)(?: +(?P[^\"]*?)(?: +\S*)?)?" (?P[^ ]*) (?P[^ ]*)(?: "(?P[^\"]*)" "(?P[^\"]*)")') 14 | 15 | sinks: 16 | output_file: 17 | type: file 18 | inputs: 19 | - transform_regex 20 | path: /home/vector-log/test.out 21 | encoding: 22 | codec: json -------------------------------------------------------------------------------- /test/dataflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/loongcollector/25452f34a10e81912732194be1e551ad2df1d04e/test/dataflow.png -------------------------------------------------------------------------------- /test/e2e/test_cases/aggregator_context/Dockerfile_1: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | RUN mkdir -p /root/test/ 19 | ENV FILE=file1 20 | CMD ["sh", "-c","/run.sh > /root/test/example.log"] -------------------------------------------------------------------------------- /test/e2e/test_cases/aggregator_context/Dockerfile_2: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | RUN mkdir -p /root/test/ 19 | ENV FILE=file2 20 | CMD ["sh", "-c","/run.sh > /root/test/example.log"] -------------------------------------------------------------------------------- /test/e2e/test_cases/aggregator_context/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 3 17 | for i in {1..100} ; do 18 | echo "$i|This is file $FILE" 19 | sleep 0.1 20 | done 21 | sleep 3600 -------------------------------------------------------------------------------- /test/e2e/test_cases/flusher_http/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | influxdb: 19 | image: influxdb:1.8.4 20 | hostname: influxdb 21 | ports: 22 | - "8086" 23 | healthcheck: 24 | test: "curl -f http://localhost:8086/ping" 25 | timeout: 5s 26 | interval: 10s 27 | retries: 3 -------------------------------------------------------------------------------- /test/e2e/test_cases/flusher_loki/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2023 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM grafana/loki:2.7.4 16 | 17 | USER root 18 | 19 | RUN apk update && apk add --no-cache curl 20 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/common/golang:1.19 16 | 17 | WORKDIR /src 18 | 19 | COPY client/* ./ 20 | RUN go env -w GO111MODULE=on 21 | RUN go env -w GOPROXY=https://goproxy.cn,direct 22 | RUN go build 23 | 24 | EXPOSE 10999 25 | 26 | CMD ["/src/client"] 27 | 28 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal/client/go.mod: -------------------------------------------------------------------------------- 1 | module client 2 | 3 | go 1.16 4 | 5 | require github.com/go-sql-driver/mysql v1.5.0 6 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal/client/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= 2 | github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 3 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal_binfile_mode/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/common/golang:1.19 16 | 17 | WORKDIR /src 18 | 19 | COPY client/* ./ 20 | RUN go env -w GO111MODULE=on 21 | RUN go env -w GOPROXY=https://goproxy.cn,direct 22 | RUN go build 23 | 24 | EXPOSE 10999 25 | 26 | CMD ["/src/client"] 27 | 28 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal_binfile_mode/client/go.mod: -------------------------------------------------------------------------------- 1 | module client 2 | 3 | go 1.16 4 | 5 | require github.com/go-sql-driver/mysql v1.5.0 6 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_canal_binfile_mode/client/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= 2 | github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 3 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_container_stdio/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"hello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_container_stdio/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_container_stdio_multiline/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"today\nhello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_container_stdio_multiline/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_event/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","sleep 5"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_event/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: input docker event 3 | Test input docker event 4 | 5 | @e2e @docker-compose 6 | Scenario: TestInputDockerEvent 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {input-container-stdio-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: service_docker_event 16 | IntervalMs: 1000 17 | """ 18 | When start docker-compose {input_docker_event} 19 | Then there is at least {2} logs 20 | Then the log fields match kv 21 | """ 22 | _time_nano_: "^[0-9]*$" 23 | _action_: "die|disconnect|exec_create|exec_start|health_status: healthy" 24 | _type_: "container|network" 25 | _id_: "^[a-z0-9]*$" 26 | """ 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_event/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_rawstdout/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"hello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_rawstdout/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | depends_on: 26 | - loongcollectorC 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_rawstdout_multiline/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"today\" && echo \"hello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_rawstdout_multiline/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | depends_on: 26 | - loongcollectorC 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_static_file/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | RUN mkdir -p /root/test/a/b/c/d/ 19 | CMD ["sh", "-c","/run.sh > /root/test/a/b/c/d/axxxxxxx.log"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_static_file/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_static_file/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 3 17 | for i in {1..1000} ; do 18 | number=$((i+4)) 19 | echo $number"=====" 20 | done 21 | sleep 3600 -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_stdout/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"hello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_stdout/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_stdout_multiline/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM busybox 16 | 17 | CMD ["sh", "-c","echo \"today\nhello\" && sleep 90"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_docker_stdout_multiline/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | environment: 24 | - STDOUT_SWITCH=true 25 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_mock_log/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: input mock log 3 | Test input mock log 4 | 5 | @e2e @docker-compose 6 | Scenario: TestInputMockLog 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {input-mock-log-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: metric_mock 16 | IntervalMs: 1000 17 | Tags: 18 | tag1: aaaa 19 | tag2: bbb 20 | Fields: 21 | content: xxxxxx 22 | time: 2017.09.12 20:55:36 23 | """ 24 | When start docker-compose {input_mock_log} 25 | Then there is at least {15} logs 26 | Then the log fields match as below 27 | """ 28 | - tag1 29 | - tag2 30 | - content 31 | - time 32 | """ -------------------------------------------------------------------------------- /test/e2e/test_cases/input_mssql/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04 16 | 17 | USER root 18 | # Create app directory 19 | RUN mkdir -p /usr/src/app 20 | WORKDIR /usr/src/app 21 | 22 | COPY . /usr/src/app 23 | 24 | # Switch back to mssql user and run the entrypoint script 25 | ENTRYPOINT /bin/bash ./entrypoint.sh -------------------------------------------------------------------------------- /test/e2e/test_cases/input_mssql/entrypoint.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2022 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #start SQL Server, start the script to create the DB and import the data 16 | /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P MSsqlpa#1word -d master -i init.sql 17 | touch /tmp/healthy 18 | sleep 100 -------------------------------------------------------------------------------- /test/e2e/test_cases/input_prometheus/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM golang:1.16 16 | 17 | WORKDIR /src 18 | 19 | COPY exporter/* ./ 20 | RUN go env -w GO111MODULE=on 21 | RUN go env -w GOPROXY=https://goproxy.cn,direct 22 | RUN go build 23 | 24 | EXPOSE 18080 25 | 26 | CMD ["/src/exporter"] 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_prometheus/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: input prometheus 3 | Test input prometheus 4 | 5 | @e2e @docker-compose 6 | Scenario: TestInputPrometheus 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {input-prometheus-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: service_prometheus 16 | Yaml: |- 17 | global: 18 | scrape_interval: 15s 19 | evaluation_interval: 15s 20 | scrape_configs: 21 | - job_name: "prometheus" 22 | static_configs: 23 | - targets: ["exporter:18080"] 24 | """ 25 | When start docker-compose {input_prometheus} 26 | Then there is at least {10} logs 27 | Then the log fields match as below 28 | """ 29 | - __name__ 30 | - __labels__ 31 | - __time_nano__ 32 | - __value__ 33 | """ -------------------------------------------------------------------------------- /test/e2e/test_cases/input_prometheus/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | exporter: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: exporter 23 | ports: 24 | - "18080:18080" -------------------------------------------------------------------------------- /test/e2e/test_cases/input_prometheus/exporter/go.mod: -------------------------------------------------------------------------------- 1 | module exporter 2 | 3 | go 1.16 4 | 5 | require github.com/prometheus/client_golang v1.12.0 6 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_static_file/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | CMD ["sh", "-c","/run.sh >> /root/a.log"] -------------------------------------------------------------------------------- /test/e2e/test_cases/input_static_file/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: input static file 3 | Test input static file 4 | 5 | @e2e @docker-compose 6 | Scenario: TestInputStaticFile 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {input-static-file-case} local config as below 12 | """ 13 | enable: true 14 | global: 15 | UsingOldContentTag: true 16 | DefaultLogQueueSize: 10 17 | inputs: 18 | - Type: input_file 19 | FilePaths: 20 | - "/root/test/**/a*.log" 21 | MaxDirSearchDepth: 10 22 | """ 23 | Given loongcollector container mount {./a.log} to {/root/test/1/2/3/axxxx.log} 24 | When start docker-compose {input_static_file} 25 | Then there is at least {1000} logs 26 | Then the log fields match kv 27 | """ 28 | "__tag__:__path__": "^/root/test/1/2/3/axxxx.log$" 29 | content: "^\\d+====" 30 | """ -------------------------------------------------------------------------------- /test/e2e/test_cases/input_static_file/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | volumes: 24 | - .:/root 25 | environment: 26 | - STDOUT_SWITCH=true 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/input_static_file/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 3 17 | for i in {1..1000} ; do 18 | number=$((i+4)) 19 | echo $number"=====" 20 | done 21 | sleep 3600 -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_deleted/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | CMD ["sh", "-c", "/run.sh"] -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_deleted/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: reader deleted 3 | Test reader deleted 4 | 5 | @e2e @docker-compose 6 | Scenario: TestReaderDeleted 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {reader-deleted-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: input_file 16 | FilePaths: 17 | - /root/test/simple.log 18 | FlushTimeoutSecs: 3 19 | """ 20 | Given loongcollector container mount {./volume} to {/root/test} 21 | When start docker-compose {reader_deleted} 22 | Then there is at least {1} logs -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_deleted/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | volumes: 24 | - ./volume:/root/volume 25 | environment: 26 | - STDOUT_SWITCH=true 27 | depends_on: 28 | - loongcollectorC 29 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_deleted/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 5 17 | echo -n "5=====" >> /root/volume/simple.log 18 | sleep 1 19 | rm /root/volume/simple.log 20 | sleep 3 -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_flush_timeout/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | CMD ["sh", "-c", "/run.sh"] -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_flush_timeout/a.log: -------------------------------------------------------------------------------- 1 | 1===== 2 | 2===== 3 | 3===== 4 | 4===== 5 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_flush_timeout/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: reader flush timeout 3 | Test reader flush timeout 4 | 5 | @e2e @docker-compose 6 | Scenario: TestReaderFlushTimeout 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {reader-flush-timeout-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: input_file 16 | FilePaths: 17 | - /root/test/simple.log 18 | FlushTimeoutSecs: 1 19 | """ 20 | Given loongcollector container mount {./a.log} to {/root/test/simple.log} 21 | When start docker-compose {reader_flush_timeout} 22 | Then there is at least {5} logs -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_flush_timeout/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | volumes: 24 | - ./a.log:/root/a.log 25 | environment: 26 | - STDOUT_SWITCH=true 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_flush_timeout/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 5 17 | echo -n "5=====" >> /root/a.log # create an event to trigger read -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_log_rotate/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | CMD ["sh", "-c", "/run.sh"] -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_log_rotate/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: reader log rotate 3 | Test reader log rotate 4 | 5 | @e2e @docker-compose 6 | Scenario: TestReaderLogRotate 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {reader-log-rotate-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: input_file 16 | FilePaths: 17 | - /root/test/simple.log 18 | FlushTimeoutSecs: 2 19 | """ 20 | Given loongcollector container mount {./volume} to {/root/test} 21 | When start docker-compose {reader_log_rotate} 22 | Then there is at least {6} logs -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_log_rotate/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | volumes: 24 | - ./volume:/root/volume 25 | environment: 26 | - STDOUT_SWITCH=true 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_log_rotate/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 5 17 | echo -n "5=====" >> /root/volume/simple.log 18 | sleep 1 19 | mv /root/volume/simple.log /root/volume/simple.log.1 20 | echo "6=====" >> /root/volume/simple.log 21 | sleep 3 -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_log_rotate/volume/simple.log: -------------------------------------------------------------------------------- 1 | 1===== 2 | 2===== 3 | 3===== 4 | 4===== 5 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_new_line_after_timeout/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM bash 16 | COPY run.sh /run.sh 17 | RUN chmod 755 /run.sh 18 | CMD ["sh", "-c", "/run.sh"] -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_new_line_after_timeout/a.log: -------------------------------------------------------------------------------- 1 | 1===== 2 | 2===== 3 | 3===== 4 | 4===== 5 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_new_line_after_timeout/case.feature: -------------------------------------------------------------------------------- 1 | @input 2 | Feature: reader new line after timeout 3 | Test reader new line after timeout 4 | 5 | @e2e @docker-compose 6 | Scenario: TestReaderNewLineAfterTimeout 7 | Given {docker-compose} environment 8 | Given subcribe data from {grpc} with config 9 | """ 10 | """ 11 | Given {reader-new-line-after-timeout-case} local config as below 12 | """ 13 | enable: true 14 | inputs: 15 | - Type: input_file 16 | FilePaths: 17 | - /root/test/a.log 18 | FlushTimeoutSecs: 1 19 | """ 20 | Given loongcollector container mount {./a.log} to {/root/test/a.log} 21 | When start docker-compose {reader_new_line_after_timeout} 22 | Then there is at least {6} logs -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_new_line_after_timeout/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.8' 16 | 17 | services: 18 | container: 19 | build: 20 | context: . 21 | dockerfile: Dockerfile 22 | hostname: container 23 | volumes: 24 | - ./a.log:/root/a.log 25 | environment: 26 | - STDOUT_SWITCH=true 27 | -------------------------------------------------------------------------------- /test/e2e/test_cases/reader_new_line_after_timeout/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 iLogtail Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | sleep 5 17 | echo -n "5=====" >> /root/a.log # create an event to trigger read 18 | sleep 3 19 | echo -e "\n6=====" >> /root/a.log -------------------------------------------------------------------------------- /test/engine/control/query.go: -------------------------------------------------------------------------------- 1 | package control 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/alibaba/ilogtail/test/config" 7 | ) 8 | 9 | func SetQuery(ctx context.Context, sql string) (context.Context, error) { 10 | return context.WithValue(ctx, config.QueryKey, sql), nil 11 | } 12 | 13 | func GetQuery(ctx context.Context) string { 14 | value := ctx.Value(config.QueryKey) 15 | if value == nil { 16 | return "*" 17 | } 18 | return value.(string) 19 | } 20 | -------------------------------------------------------------------------------- /test/engine/trigger/ebpf/remote_mmap.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import mmap 3 | import os 4 | 5 | def main(): 6 | parser = argparse.ArgumentParser(description='mmap') 7 | parser.add_argument('--commandCnt', type=int, default=10, help='command count') 8 | parser.add_argument('--filename', type=str, default='/tmp/loongcollector/ebpfFileSecurityHook3.log', help='filename') 9 | 10 | args = parser.parse_args() 11 | 12 | with open(args.filename, 'w') as f: 13 | fd = f.fileno() 14 | for i in range(args.commandCnt): 15 | mm = mmap.mmap(fd, 20, prot=mmap.PROT_READ | mmap.PROT_WRITE, flags=mmap.MAP_SHARED) 16 | mm.close() 17 | 18 | os.remove(args.filename) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /test/requirements.txt: -------------------------------------------------------------------------------- 1 | Faker==30.8.2 -------------------------------------------------------------------------------- /tools/builder/templates/all.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by "github.com/alibaba/ilogtail/tools/builder". DO NOT EDIT. 2 | // Copyright 2021 iLogtail Authors 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | package all 17 | {{range .Config.Plugins.Common}} 18 | import _ "{{.Import}}" 19 | {{- end}} -------------------------------------------------------------------------------- /tools/builder/templates/all_debug.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by "github.com/alibaba/ilogtail/tools/builder". DO NOT EDIT. 2 | // Copyright 2021 iLogtail Authors 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | //go:build debug 17 | // +build debug 18 | 19 | package all 20 | {{range .Config.Plugins.Debug}} 21 | import _ "{{.Import}}" 22 | {{- end}} -------------------------------------------------------------------------------- /tools/builder/templates/all_linux.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by "github.com/alibaba/ilogtail/tools/builder". DO NOT EDIT. 2 | // Copyright 2021 iLogtail Authors 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | //go:build linux 17 | // +build linux 18 | 19 | package all 20 | {{range .Config.Plugins.Linux}} 21 | import _ "{{.Import}}" 22 | {{- end}} -------------------------------------------------------------------------------- /tools/builder/templates/all_windows.go.tmpl: -------------------------------------------------------------------------------- 1 | // Code generated by "github.com/alibaba/ilogtail/tools/builder". DO NOT EDIT. 2 | // Copyright 2021 iLogtail Authors 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | //go:build windows 17 | // +build windows 18 | 19 | package all 20 | {{range .Config.Plugins.Windows}} 21 | import _ "{{.Import}}" 22 | {{- end}} -------------------------------------------------------------------------------- /tools/builder/templates/go.mod.tmpl: -------------------------------------------------------------------------------- 1 | {{.GoModContent}} 2 | 3 | {{range .Config.Plugins.Common}} 4 | {{if .GoMod}}require {{.GoMod}}{{end}} 5 | {{- end}} 6 | {{- range .Config.Plugins.Windows}} 7 | {{if .GoMod}}require {{.GoMod}}{{end}} 8 | {{- end}} 9 | {{- range .Config.Plugins.Linux}} 10 | {{if .GoMod}}require {{.GoMod}}{{end}} 11 | {{- end}} 12 | {{- range .Config.Plugins.Debug}} 13 | {{if .GoMod}}require {{.GoMod}}{{end}} 14 | {{- end}} 15 | 16 | {{- range .Config.Plugins.Common}} 17 | {{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{- end}} 18 | {{- end}} 19 | {{- range .Config.Plugins.Windows}} 20 | {{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{- end}} 21 | {{- end}} 22 | {{- range .Config.Plugins.Linux}} 23 | {{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{- end}} 24 | {{- end}} 25 | {{- range .Config.Plugins.Debug}} 26 | {{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{- end}} 27 | {{- end}} 28 | {{- range .Config.Project.Replaces}} 29 | replace {{.}} 30 | {{- end}} -------------------------------------------------------------------------------- /tools/builder/testdata/external_plugins.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 iLogtail Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | plugins: 16 | common: 17 | - gomod: "github.com/mock/ilogtail_plugin1 v1.0.0" 18 | - gomod: "github.com/mock/ilogtail_plugin2 v1.0.0" 19 | import: "github.com/mock/ilogtail_plugin" --------------------------------------------------------------------------------