Hi there,
I wanted to replace the @timestamp value with the log time. I am using logstash as a logs collector. This is not working for me and it still adds my local time stamp to the logs parsed.
Here is my configuration value which I am trying
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
file {
path => "/Users/fsyed/workspaces/vault_logs/tmp/*.log"
start_position => "beginning"
max_open_files => 64000
codec => "json"
sincedb_path => "/dev/null"
}
}
filter {
json {
source => "message"
}
date {
match => [ "time", "MMM dd, yyyy @ HH:mm:ss.SSS" ]
target => "@timestamp"
}
mutate {
remove_field => ["[log][file][path]"]
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => [ "https://0.0.0.0:9200" ]
ssl_certificate_verification => false
user => "elastic"
password => "##########"
index => "vault-%{+YYYY.MM.dd}"
}
}
Here is a the output of my audit log file.
"file": "/var/log/vault/audit.log",
"host": "ip-10-66-9-115",
"message": "{\"time\":\"2024-04-10T07:54:10.196277961Z\",\"type\":\"response\",\"auth\":{\"client_token\":\"hmac-sha256:fd91e5d3670b9302c0a51a8cfeaa4121993c09e127cd55a2f9d4a15ba304cea5\",\"accessor\":\"hmac-sha256:ab037477767efa3229a2e55ceb6e89e8111f645fb9c0a6e8e9075518a9bd3bc5\",\"display_name\":\"k8s-ripplenet-prod-liquidity-voltron-eng-wf-wallet-funding-balance\",\"policies\":[\"default\",\"locus-3b416-balance-app-policy\"],\"token_policies\":[\"default\",\"locus-3b416-balance-app-policy\"],\"policy_results\":{\"allowed\":true,\"granting_policies\":[{\"name\":\"locus-3b416-balance-app-policy\",\"namespace_id\":\"root\",\"type\":\"acl\"}]},\"metadata\":{\"role\":\"locus-3b416-balance-app-role\",\"service_account_name\":\"wallet-funding-balance\",\"service_account_namespace\":\"liquidity-ewewde-eng-wf\",\"service_account_secret_name\":\"\",\"service_account_uid\":\"93e727b5-9c52-4f01-959c-dfc5af57f0b1\"},\"entity_id\":\"016e1cb6-dc03-e745-c3c6-cb788aeb644c\",\"token_type\":\"service\",\"token_ttl\":86400,\"token_issue_time\":\"2024-04-02T23:02:54Z\"},\"request\":{\"id\":\"486df7c9-322e-b750-d542-8e79bca277e7\",\"client_id\":\"016e1cb6-dc03-e745-c3c6-cb788aeb644c\",\"operation\":\"update\",\"mount_point\":\"data_encryption/liquiltron/eng/strato/\",\"mount_type\":\"transit\",\"mount_accessor\":\"transit_27361b44\",\"mount_running_version\":\"v1.14.1+builtin.vault\",\"mount_class\":\"secret\",\"client_token\":\"hmac-*****************\",\"client_token_accessor\":\"hmac-sha***************************************\",\"namespace\":{\"id\":\"root\"},\"path\":\"data_encryption/key\",\"data\":{\"ciphertext\":\"hmac-sha*********************************************\",\"context\":\"hmac-sha*************************************************\"},\"remote_address\":\"10.66.11.164\",\"remote_port\":37642},\"response\":{\"mount_point\":\"data_encryption/eng/strato/\",\"mount_type\":\"transit\",\"mount_accessor\":\"transit_27361b44\",\"mount_running_plugin_version\":\"v1.14.1+builtin.vault\",\"mount_class\":\"secret\",\"data\":{\"plaintext\":\"hmac-sha256:a********************************************\"}}}",
"source_type": "file",
"timestamp": "2024-04-10T07:54:10.404110412Z"
}