I have a JSON string I am running a replace method on, I would like to replace the second instance of a sub string In the JSON string. please see the string below.
I have two instances of this string pw.alert.timestamp.iso
I would like to skip the first instance and replace the second instance.
{ "blocks": [{"type": "header","text": {"type": "plain_text","text": "{{pw.alert.severity}} - {{details}} - {{open_violations_count_critical}}"}} ], "attachments": [{"color": "{{pw.state.severityColor}}","blocks": [{"type": "section","text": {"type": "plain_text","text": "Triggered: {{pw.state.workflowId}}"}},{"type": "section","text": {"text": "Triggered: {{metadata}}","type": "plain_text"}},{"type": "section","text": {"text": "Triggered: {{pw.alert.timestamp.iso}}","type": "plain_text"}},{"text": {"text": "{{pw.alert.description}}","type": "mrkdwn"},"type": "section"},{"type": "actions","elements": [{"url": "{{pw.alert.alertUrl}}","type": "button","value": "View Alert","action_id": "button-action-1","text": {"text": "View Alert","emoji": true,"type": "plain_text"}}]},{"text": {"type": "plain_text","text": "CORRELATIONS"},"type": "header"},{"text": {"text": "<{{pw.link.openall}} | *Open All*> | <{{pw.link.downloadall}} | *Download All*>","type": "mrkdwn"},"type": "section"},{"type": "header","text": {"type": "plain_text","emoji": true,"text": "{{pw.workflow.destinationGroup.1.name}}"}},{"type": "divider"},{"text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.1.destination.0.url}} | * {{pw.workflow.destinationGroup.1.destination.0.name}}*>"},"type": "section"},{"text": {"text": "<{{pw.workflow.destinationGroup.1.destination.1.url}} | * {{pw.workflow.destinationGroup.1.destination.1.name}}*>","type": "mrkdwn"},"type": "section"},{"text": {"text": "<{{pw.workflow.destinationGroup.1.destination.2.url}} | * {{pw.workflow.destinationGroup.1.destination.2.name}}*>","type": "mrkdwn"},"type": "section"},{"text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.1.destination.3.url}} | * {{pw.workflow.destinationGroup.1.destination.3.name}}*>"},"type": "section"},{"type": "section","text": {"text": "<{{pw.workflow.destinationGroup.1.destination.4.url}} | * {{pw.workflow.destinationGroup.1.destination.4.name}}*>","type": "mrkdwn"}},{"type": "section","text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.1.destination.5.url}} | * {{pw.workflow.destinationGroup.1.destination.5.name}}*>"}},{"type": "header","text": {"type": "plain_text","emoji": true,"text": "{{pw.workflow.destinationGroup.2.name}}"}},{"type": "divider"},{"text": {"text": "<{{pw.workflow.destinationGroup.2.destination.0.url}} | * {{pw.workflow.destinationGroup.2.destination.0.name}}*>","type": "mrkdwn"},"type": "section"},{"type": "header","text": {"text": "{{pw.workflow.destinationGroup.3.name}}","emoji": true,"type": "plain_text"}},{"type": "divider"},{"type": "section","text": {"text": "<{{pw.workflow.destinationGroup.3.destination.0.url}} | * {{pw.workflow.destinationGroup.3.destination.0.name}}*>","type": "mrkdwn"}},{"text": {"text": "{{pw.workflow.destinationGroup.4.name}}","emoji": true,"type": "plain_text"},"type": "header"},{"type": "divider"},{"text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.4.destination.0.url}} | * {{pw.workflow.destinationGroup.4.destination.0.name}}*>"},"type": "section"},{"text": {"text": "<{{pw.workflow.destinationGroup.4.destination.1.url}} | * {{pw.workflow.destinationGroup.4.destination.1.name}}*>","type": "mrkdwn"},"type": "section"},{"text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.4.destination.2.url}} | * {{pw.workflow.destinationGroup.4.destination.2.name}}*>"},"type": "section"},{"text": {"text": "<{{pw.workflow.destinationGroup.4.destination.3.url}} | * {{pw.workflow.destinationGroup.4.destination.3.name}}*>","type": "mrkdwn"},"type": "section"},{"text": {"type": "plain_text","text": ": camera: Snapshots","emoji": true},"type": "header"},{"type": "divider"},{"type": "section","text": {"text": "<{{pw.workflow.destinationGroup.1.destination.0.snapshot.protectedUrl}} | *High-Resolution Image: {{pw.workflow.destinationGroup.1.destination.0.name}}*>","type": "mrkdwn"}},{"title": {"emoji": true,"type": "plain_text","text": "{{pw.workflow.destinationGroup.1.destination.0.name}}"},"alt_text": "{{pw.workflow.destinationGroup.1.destination.0.name}}","image_url": "{{pw.workflow.destinationGroup.1.destination.0.snapshot.publicUrl}}","type": "image"},{"type": "section","text": {"type": "mrkdwn","text": "<{{pw.workflow.destinationGroup.1.destination.3.snapshot.protectedUrl}} | *High-Resolution Image: {{pw.workflow.destinationGroup.1.destination.3.name}}*>"}},{"type": "image","alt_text": "{{pw.workflow.destinationGroup.1.destination.3.name}}","image_url": "{{pw.workflow.destinationGroup.1.destination.3.snapshot.publicUrl}}","title": {"emoji": true,"text": "{{pw.workflow.destinationGroup.1.destination.3.name}}","type": "plain_text"}}]} ]}