Hi All,
I have one requirement.
I have one Dashboard in form of table and have one hyperlink column in it.
My hyperlink column is "url" and its like below:
The issue here is after 444 there are two // it should be only one.
How can I parse this string.
Can someone guide me.
Thanks in advance
Try fewer backslashes
| rex field=url mode=sed "s/\\/\\//\\//g s/https:/https:\\//g"
or
| rex field=url mode=sed "s/\/\//\//g s/https:/https:\//g"
You could try converting // to / and then put the double // back in after the https:
| rex field=url mode=sed "s/\\\/\\\//\\\//g s/https:/https:\\\//g"
(Not sure if the number of backslashes is correct)
Does it matter? Doesn't the browser handle it for you anyway?
I am getting the below Error. Can you guide me where I have gone wrong.
Error in 'rex' command: Failed to initialize sed. Invalid option string: /\\//g
Below is the query for the same:
<row>
<panel>
<table>
<search>
<query>index=abc sourcetype=xyz source="/nifi-user.log" $process_tok1$
| rex field=_raw "(?<id>[A_Za-z0-9]{8}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{4}[\-][A_Za-z0-9]{12})"
| join type=outer id [inputlookup nifi_api_parent_chains_e1.csv]|search $ckey$|search $usr$|eval ClickHere=url| rex field=url mode=sed "s/\\\/\\\//\\\//g s/https:/https:\\\//g"
| table _time _raw host id parent_chain url
</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">cell</option>
<option name="percentagesRow">false</option>
<option name="refresh.display">progressbar</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
<fields>["_time","_raw","host","id","parent_chain","url"]</fields>
<drilldown>
<condition field="url">
<link target="_blank">$row.url|n$</link>
</condition>
</drilldown>
</table>
Try fewer backslashes
| rex field=url mode=sed "s/\\/\\//\\//g s/https:/https:\\//g"
or
| rex field=url mode=sed "s/\/\//\//g s/https:/https:\//g"