Bug: fix(opensearch): Add date-suffixed indexes for opensearch locally



Currently the events get pushed to indexes of the form `{{ .topic }}`
In addition we can push the events to date-suffixed indexes of the form
- `vector-{{ .topic }}-%Y-%m-%d` for events pushed through vector
- `fluentd-{{ .topic }}-%Y-%m-%d` for events pushed through fluentd
diff --git a/config/vector.yaml b/config/vector.yaml
index 17049677fe5..54ff25cab5a 100644
--- a/config/vector.yaml
+++ b/config/vector.yaml
@@ -71,7 +71,7 @@ transforms:
     window_secs: 60
 
 sinks:
-  opensearch_events:
+  opensearch_events_1:
     type: elasticsearch
     inputs:
       - events
@@ -93,9 +93,32 @@ sinks:
         - partition
         - topic
     bulk:
-      # Add a date prefixed index for better grouping
-      # index: "vector-{{ .topic }}-%Y-%m-%d"
-      index: "{{ .topic }}"
+      index: "vector-{{ .topic }}"
+
+  opensearch_events_2:
+    type: elasticsearch
+    inputs:
+      - events
+    endpoints:
+      - "https://opensearch:9200"
+    id_key: message_key
+    api_version: v7
+    tls:
+      verify_certificate: false
+      verify_hostname: false
+    auth:
+      strategy: basic
+      user: admin
+      password: 0penS3arc#
+    encoding:
+      except_fields:
+        - message_key
+        - offset
+        - partition
+        - topic
+    bulk:
+      # Add a date suffixed index for better grouping
+      index: "vector-{{ .topic }}-%Y-%m-%d"
 
   opensearch_logs:
     type: elasticsearch
@@ -112,7 +135,7 @@ sinks:
       user: admin
       password: 0penS3arc#
     bulk:
-      # Add a date prefixed index for better grouping
+      # Add a date suffixed index for better grouping
       # index: "vector-{{ .topic }}-%Y-%m-%d"
       index: "logs-{{ .container_name }}-%Y-%m-%d"
 
diff --git a/crates/analytics/docs/README.md b/crates/analytics/docs/README.md
index da9a3c79f1f..96218fc231c 100644
--- a/crates/analytics/docs/README.md
+++ b/crates/analytics/docs/README.md
@@ -108,11 +108,11 @@ global_search=true
 
 To view the data on the OpenSearch dashboard perform the following steps:
 
-- Go to the OpenSearch Dashboard home and click on `Stack Management` under the Management tab
+- Go to the OpenSearch Dashboard home and click on `Dashboards Management` under the Management tab
 - Select `Index Patterns`
 - Click on `Create index pattern`
 - Define an index pattern with the same name that matches your indices and click on `Next Step`
 - Select a time field that will be used for time-based queries
 - Save the index pattern
 
-Now, head on to the `Discover` tab, to select the newly created index pattern and query the data
\ No newline at end of file
+Now, head on to `Discover` under the `OpenSearch Dashboards` tab, to select the newly created index pattern and query the data
\ No newline at end of file
diff --git a/docker/fluentd/conf/fluent.conf b/docker/fluentd/conf/fluent.conf
index 785254a3b25..d0f7c861c32 100644
--- a/docker/fluentd/conf/fluent.conf
+++ b/docker/fluentd/conf/fluent.conf
@@ -47,7 +47,25 @@
     index_name hyperswitch-payment-intent-events
     id_key payment_id
     user admin
-    password admin
+    password '0penS3arc#'
+    ssl_verify false
+    prefer_oj_serializer true
+    reload_on_failure true
+    reload_connections false
+    request_timeout 120s
+    bulk_message_request_threshold 10MB
+    include_timestamp true
+  </store>
+
+  <store>
+    @type opensearch
+    host opensearch
+    port 9200
+    scheme https
+    index_name fluentd-hyperswitch-payment-intent-events-%Y-%m-%d
+    id_key payment_id
+    user admin
+    password '0penS3arc#'
     ssl_verify false
     prefer_oj_serializer true
     reload_on_failure true
@@ -55,6 +73,10 @@
     request_timeout 120s
     bulk_message_request_threshold 10MB
     include_timestamp true
+    <buffer tag, time>
+      timekey 10s
+      timekey_wait 10s
+    </buffer>
   </store>
 </match>
 
@@ -73,7 +95,25 @@
     index_name hyperswitch-payment-attempt-events
     id_key attempt_id
     user admin
-    password admin
+    password '0penS3arc#'
+    ssl_verify false
+    prefer_oj_serializer true
+    reload_on_failure true
+    reload_connections false
+    request_timeout 120s
+    bulk_message_request_threshold 10MB
+    include_timestamp true
+  </store>
+
+  <store>
+    @type opensearch
+    host opensearch
+    port 9200
+    scheme https
+    index_name fluentd-hyperswitch-payment-attempt-events-%Y-%m-%d
+    id_key attempt_id
+    user admin
+    password '0penS3arc#'
     ssl_verify false
     prefer_oj_serializer true
     reload_on_failure true
@@ -81,6 +121,10 @@
     request_timeout 120s
     bulk_message_request_threshold 10MB
     include_timestamp true
+    <buffer tag, time>
+      timekey 10s
+      timekey_wait 10s
+    </buffer>
   </store>
 </match>
 
@@ -99,7 +143,25 @@
     index_name hyperswitch-refund-events
     id_key refund_id
     user admin
-    password admin
+    password '0penS3arc#'
+    ssl_verify false
+    prefer_oj_serializer true
+    reload_on_failure true
+    reload_connections false
+    request_timeout 120s
+    bulk_message_request_threshold 10MB
+    include_timestamp true
+  </store>
+
+  <store>
+    @type opensearch
+    host opensearch
+    port 9200
+    scheme https
+    index_name fluentd-hyperswitch-refund-events-%Y-%m-%d
+    id_key refund_id
+    user admin
+    password '0penS3arc#'
     ssl_verify false
     prefer_oj_serializer true
     reload_on_failure true
@@ -107,6 +169,10 @@
     request_timeout 120s
     bulk_message_request_threshold 10MB
     include_timestamp true
+    <buffer tag, time>
+      timekey 10s
+      timekey_wait 10s
+    </buffer>
   </store>
 </match>
 
@@ -134,4 +200,26 @@
     bulk_message_request_threshold 10MB
     include_timestamp true
   </store>
+
+  <store>
+    @type opensearch
+    host opensearch
+    port 9200
+    scheme https
+    index_name fluentd-hyperswitch-dispute-events-%Y-%m-%d
+    id_key dispute_id
+    user admin
+    password '0penS3arc#'
+    ssl_verify false
+    prefer_oj_serializer true
+    reload_on_failure true
+    reload_connections false
+    request_timeout 120s
+    bulk_message_request_threshold 10MB
+    include_timestamp true
+    <buffer tag, time>
+      timekey 10s
+      timekey_wait 10s
+    </buffer>
+  </store>
 </match>
\ No newline at end of file

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Currently the events get pushed to indexes of the form `{{ .topic }}` locally.
In addition we can now push the events to date-suffixed indexes of the form
- `vector-{{ .topic }}-%Y-%m-%d for events pushed through vector`
- `fluentd-{{ .topic }}-%Y-%m-%d for events pushed through fluentd`

We can also have the existing indexes for aggregating events for the respective indexes of the form
- `vector-{{ .topic }}` (pushed through vector)
- `{{ .topic }}` (pushed through fluentd)

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Can have respective results pushed to date-specific indexes for better analytics

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Made payments, and ensured the creation of separate indexes on opensearch from both fluentd and vector
<img width="1303" alt="Screenshot 2024-08-14 at 7 23 14 PM" src="https://github.com/user-attachments/assets/9269f65c-c95c-4388-9196-7d8893dcb098">
<img width="1313" alt="Screenshot 2024-08-14 at 7 23 23 PM" src="https://github.com/user-attachments/assets/e4454177-3655-4c32-b96f-83b8c9a68a04">
<img width="1719" alt="Screenshot 2024-08-14 at 7 23 41 PM" src="https://github.com/user-attachments/assets/b9eefe7d-c372-4d90-9dc7-cdfc5fe63190">
<img width="1726" alt="Screenshot 2024-08-14 at 7 23 49 PM" src="https://github.com/user-attachments/assets/c74b2407-80eb-4b97-a3f7-9bde573cce5e">
<img width="1728" alt="Screenshot 2024-08-14 at 7 23 58 PM" src="https://github.com/user-attachments/assets/568dcb0f-b332-4908-97c2-4889230f2747">
![image](https://github.com/user-attachments/assets/67cddc8b-cdd4-45b8-8ce8-1f786c7f8306)


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
