|
| 1 | +########################### This section holds all the |
| 2 | +## Configuration section ## configurations that can be |
| 3 | +########################### used in this OpenTelemetry Collector |
| 4 | +extensions: # Array of Extensions |
| 5 | + health_check: # Configures the health check extension |
| 6 | + endpoint: 0.0.0.0:13133 # Endpoint to collect health check data |
| 7 | + file_storage/checkpoint: # Extension Type/Name |
| 8 | + directory: "./checkpoint-dir" # Define directory |
| 9 | + create_directory: true # Create directory |
| 10 | + timeout: 1s # Timeout for file operations |
| 11 | + compaction: # Compaction settings |
| 12 | + on_start: true # Start compaction at Collector startup |
| 13 | + # Define compaction directory |
| 14 | + directory: "./checkpoint-dir/tmp" |
| 15 | + # Max. size limit before compaction occurs |
| 16 | + max_transaction_size: 65536 |
| 17 | + |
| 18 | +receivers: # Array of Receivers |
| 19 | + hostmetrics: # Receiver Type |
| 20 | + collection_interval: 3600s # Scrape metrics every hour |
| 21 | + scrapers: # Array of hostmetric scrapers |
| 22 | + cpu: # Scraper for cpu metrics |
| 23 | + otlp: # Receiver Type |
| 24 | + protocols: # list of Protocols used |
| 25 | + http: # This wil enable the HTTP Protocol |
| 26 | + endpoint: "0.0.0.0:4318" # Endpoint for incoming telemetry data |
| 27 | + filelog/quotes: # Receiver Type/Name |
| 28 | + include: ./quotes.log # The file to read log data from |
| 29 | + include_file_path: true # Include file path in the log data |
| 30 | + include_file_name: false # Exclude file name from the log data |
| 31 | + resource: # Add custom resource attributes |
| 32 | + com.splunk.source: ./quotes.log # Source of the log data |
| 33 | + com.splunk.sourcetype: quotes # Source type of the log data |
| 34 | + |
| 35 | +exporters: # Array of Exporters |
| 36 | + debug: # Exporter Type |
| 37 | + verbosity: detailed # Enabled detailed debug output |
| 38 | + file: # Exporter Type |
| 39 | + path: "./agent.out" # Save path (OTLP JSON) |
| 40 | + append: false # Overwrite the file each time |
| 41 | + otlphttp: # Exporter Type |
| 42 | + endpoint: "http://localhost:5318" # Gateway OTLP endpoint |
| 43 | + headers: # Headers to add to the HTTPcall |
| 44 | + X-SF-Token: "ACCESS_TOKEN" # Splunk ACCESS_TOKEN header |
| 45 | + retry_on_failure: # Retry on failure settings |
| 46 | + enabled: true # Enables retrying |
| 47 | + sending_queue: # Sending queue settings |
| 48 | + enabled: true # Enables Sending queue |
| 49 | + num_consumers: 10 # Number of consumers |
| 50 | + queue_size: 10000 # Maximum queue size |
| 51 | + # File storage extension |
| 52 | + storage: file_storage/checkpoint |
| 53 | + |
| 54 | +processors: # Array of Processors |
| 55 | + memory_limiter: # Limits memory usage by Collectors pipeline |
| 56 | + check_interval: 2s # Interval to check memory usage |
| 57 | + limit_mib: 512 # Memory limit in MiB |
| 58 | + resourcedetection: # Processor Type |
| 59 | + detectors: [system] # Detect system resource information |
| 60 | + override: true # Overwrites existing attributes |
| 61 | + resource/add_mode: # Processor Type/Name |
| 62 | + attributes: # Array of attributes and modifications |
| 63 | + - action: insert # Action is to insert a key |
| 64 | + key: otelcol.service.mode # Key name |
| 65 | + value: "agent" # Key value |
| 66 | + batch: # Processor Type |
| 67 | + metadata_keys: [X-SF-Token] # Array of metadata keys to batch |
| 68 | + attributes/update: # Processor Type/Name |
| 69 | + actions: # List of actions |
| 70 | + - key: user.phone_number # Target key |
| 71 | + action: update # Replace value with "UNKNOWN NUMBER" |
| 72 | + value: "UNKNOWN NUMBER" |
| 73 | + - key: user.email # Hash the email value |
| 74 | + action: hash |
| 75 | + - key: user.account_password # Remove the password |
| 76 | + action: delete |
| 77 | + redaction/redact: # Processor Type/Name |
| 78 | + allow_all_keys: true # If false, only allowed keys will be retained |
| 79 | + blocked_values: # List of regex patterns to hash |
| 80 | + - '\b4[0-9]{3}[\s-]?[0-9]{4}[\s-]?[0-9]{4}[\s-]?[0-9]{4}\b' # Visa card |
| 81 | + - '\b5[1-5][0-9]{2}[\s-]?[0-9]{4}[\s-]?[0-9]{4}[\s-]?[0-9]{4}\b' # MasterCard |
| 82 | + summary: debug # Show debug details about redaction |
| 83 | + transform/logs: # Processor Type/Name |
| 84 | + log_statements: # Log Processing Statements |
| 85 | + - context: resource # Log Context |
| 86 | + statements: # List of attribute keys to keep |
| 87 | + - keep_keys(attributes, ["com.splunk.sourcetype", "host.name", "otelcol.service.mode"]) |
| 88 | + - context: log # Log Context |
| 89 | + statements: # Transform Statements Array |
| 90 | + - set(cache, ParseJSON(body)) where IsMatch(body, "^\\{") |
| 91 | + - flatten(cache, "") |
| 92 | + - merge_maps(attributes, cache, "upsert") |
| 93 | + - set(severity_text, attributes["level"]) |
| 94 | + - set(severity_number, 1) where severity_text == "TRACE" |
| 95 | + - set(severity_number, 5) where severity_text == "DEBUG" |
| 96 | + - set(severity_number, 9) where severity_text == "INFO" |
| 97 | + - set(severity_number, 13) where severity_text == "WARN" |
| 98 | + - set(severity_number, 17) where severity_text == "ERROR" |
| 99 | + - set(severity_number, 21) where severity_text == "FATAL" |
| 100 | + |
| 101 | +########################### This section controls what |
| 102 | +### Activation Section ### configurations will be used |
| 103 | +########################### by this OpenTelemetry Collector |
| 104 | +service: # Services configured for this Collector |
| 105 | + extensions: # Enabled extensions |
| 106 | + - health_check |
| 107 | + - file_storage/checkpoint # Enabled extensions for this collector |
| 108 | + |
| 109 | + pipelines: # Array of configured pipelines |
| 110 | + traces: |
| 111 | + receivers: |
| 112 | + - otlp |
| 113 | + processors: |
| 114 | + - memory_limiter # Memory Limiter processor |
| 115 | + - attributes/update # Update, hash, and remove attributes |
| 116 | + - redaction/redact # Redact sensitive fields using regex |
| 117 | + - resourcedetection # Adds system attributes to the data |
| 118 | + - resource/add_mode # Adds collector mode metadata |
| 119 | + - batch |
| 120 | + exporters: |
| 121 | + - debug |
| 122 | + - otlphttp |
| 123 | + metrics: |
| 124 | + receivers: |
| 125 | + - otlp |
| 126 | + # - hostmetrics |
| 127 | + processors: |
| 128 | + - memory_limiter # Memory Limiter processor |
| 129 | + - resourcedetection # Adds system attributes to the data |
| 130 | + - resource/add_mode # Adds collector mode metadata |
| 131 | + - batch |
| 132 | + exporters: |
| 133 | + - debug |
| 134 | + - otlphttp |
| 135 | + logs: |
| 136 | + receivers: |
| 137 | + - otlp |
| 138 | + - filelog/quotes |
| 139 | + processors: |
| 140 | + - memory_limiter # Memory Limiter processor |
| 141 | + - resourcedetection # Adds system attributes to the data |
| 142 | + - resource/add_mode # Adds collector mode metadata |
| 143 | + - transform/logs |
| 144 | + - batch |
| 145 | + exporters: |
| 146 | + - debug |
| 147 | + - otlphttp |
0 commit comments