<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I replace ',&amp;quot; with &amp;quot;;&amp;quot; between a bracket? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383641#M112057</link>
    <description>&lt;P&gt;Hi @jianyu75074 ,&lt;/P&gt;

&lt;P&gt;You may use the below regex to extract the field values instead of using delimiter. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "(?P&amp;lt;nodetype&amp;gt;\w+[^\,]+),(?P&amp;lt;nodename&amp;gt;\w+[^\,]+),(?P&amp;lt;interface1&amp;gt;[^\,]*),(?P&amp;lt;interface2&amp;gt;[^\,]*),(?P&amp;lt;interface3&amp;gt;\{.*?\}),(?P&amp;lt;interface4&amp;gt;[^\,]*),(?P&amp;lt;interfce5&amp;gt;\{.*?\})"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank You!&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jan 2019 09:38:20 GMT</pubDate>
    <dc:creator>MousumiChowdhur</dc:creator>
    <dc:date>2019-01-02T09:38:20Z</dc:date>
    <item>
      <title>How do I replace '," with ";" between a bracket?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383639#M112055</link>
      <description>&lt;P&gt;I have raw data:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IMS,CSCF1,,,{REGISTER,19728881234@domain.com;user=phone,200},,{PUBLISH,19728881234@domain.com;user=phone,200}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want the results as below.  The field positions are fixed. Each interface field may present with value or not:&lt;/P&gt;

&lt;P&gt;(null)&lt;BR /&gt;
field1 is node type = "IMS" &lt;BR /&gt;
field2 is node name = CSCF1&lt;BR /&gt;
field3 is interface1 = null here&lt;BR /&gt;
field4 is interface2 = null here &lt;BR /&gt;
field5 is interface3 =  &lt;CODE&gt;"{REGISTER,19728881234@domain.com;user=phone,200}"&lt;/CODE&gt;&lt;BR /&gt;
field6 is interface4 = null here&lt;BR /&gt;
field7 is interface5 = &lt;CODE&gt;"{PUBLISH,19728881234@domain.com;user=phone,200}"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I am going to do field extraction with delimiter ",".   My problem is there is "," inside of  interface field. If I can replace "," with ";"  e.g.  &lt;CODE&gt;"{REGISTER;19728881234@domain.com;user=phone];200}"&lt;/CODE&gt;,  then I think I can delimit it. &lt;/P&gt;

&lt;P&gt;So, my question is, how do I change my original data to: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IMS,CSCF1,,,{REGISTER;19728881234@domain.com;user=phone;200},,{PUBLISH;19728881234@domain.com;user=phone;200}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or do you have a better suggestion? Thank you very much! &lt;/P&gt;</description>
      <pubDate>Tue, 01 Jan 2019 15:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383639#M112055</guid>
      <dc:creator>jianyu75074</dc:creator>
      <dc:date>2019-01-01T15:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I replace '," with ";" between a bracket?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383640#M112056</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Can you try the below rex and see whether it resolves your query, I have given an example search too,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval str = "IMS,CSCF1,,,{REGISTER,19728881234@domain.com;user=phone,200},,{PUBLISH,19728881234@domain.com;user=phone,200}"
| rex field=str "(?&amp;lt;node_type&amp;gt;\w*),(?&amp;lt;node_name&amp;gt;\w*),(?&amp;lt;interface1&amp;gt;{.*})?,(?&amp;lt;interface2&amp;gt;{.*})?,(?&amp;lt;interface3&amp;gt;{.*})?,(?&amp;lt;interface4&amp;gt;{.*})?,(?&amp;lt;interface5&amp;gt;{.*})?"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sid&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 09:18:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383640#M112056</guid>
      <dc:creator>sdchakraborty</dc:creator>
      <dc:date>2019-01-02T09:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I replace '," with ";" between a bracket?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383641#M112057</link>
      <description>&lt;P&gt;Hi @jianyu75074 ,&lt;/P&gt;

&lt;P&gt;You may use the below regex to extract the field values instead of using delimiter. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "(?P&amp;lt;nodetype&amp;gt;\w+[^\,]+),(?P&amp;lt;nodename&amp;gt;\w+[^\,]+),(?P&amp;lt;interface1&amp;gt;[^\,]*),(?P&amp;lt;interface2&amp;gt;[^\,]*),(?P&amp;lt;interface3&amp;gt;\{.*?\}),(?P&amp;lt;interface4&amp;gt;[^\,]*),(?P&amp;lt;interfce5&amp;gt;\{.*?\})"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 09:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-replace-quot-with-quot-quot-between-a-bracket/m-p/383641#M112057</guid>
      <dc:creator>MousumiChowdhur</dc:creator>
      <dc:date>2019-01-02T09:38:20Z</dc:date>
    </item>
  </channel>
</rss>

