<?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: different format field extraction using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583354#M203130</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242695"&gt;@BT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^((\&amp;lt;soafault:faultDescription\&amp;gt;)|(\"faultDescription\"\s+:\s+\"))(?&amp;lt;faultDescription&amp;gt;[^\"\&amp;lt;]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UR6ETx/1" target="_blank"&gt;https://regex101.com/r/UR6ETx/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 10:01:13 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-02-02T10:01:13Z</dc:date>
    <item>
      <title>different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583353#M203129</link>
      <description>&lt;P&gt;Hello&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me out here.&lt;/P&gt;&lt;P&gt;I was trying to extract a field "faultDescription". but the logs have different format for each event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;event 1:&amp;nbsp;"faultDescription" : "Backend system error has occurred.",&lt;/P&gt;&lt;P&gt;event 2 :&amp;nbsp;&amp;lt;soafault:faultDescription&amp;gt;SKU is not provided&amp;lt;/soafault:faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;event 3:&amp;nbsp;&amp;lt;soafault:faultDescription&amp;gt;SKU is not provided&amp;lt;/soafault:faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have tried below rex command, and it works for event 1 and 3. But how to write a command which will extract fault description in all 3 formats.&lt;/P&gt;&lt;P&gt;There is space between faultdescription" and : hence not able to write a expression which will involve all 3 events&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have tried :&amp;nbsp;| rex field=_raw "faultDescription+.\s:\s(?P&amp;lt;description&amp;gt;.+),"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 09:52:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583353#M203129</guid>
      <dc:creator>BT</dc:creator>
      <dc:date>2022-02-02T09:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583354#M203130</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242695"&gt;@BT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^((\&amp;lt;soafault:faultDescription\&amp;gt;)|(\"faultDescription\"\s+:\s+\"))(?&amp;lt;faultDescription&amp;gt;[^\"\&amp;lt;]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UR6ETx/1" target="_blank"&gt;https://regex101.com/r/UR6ETx/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583354#M203130</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-02T10:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583356#M203132</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the rex command which was provided by you.. Thank you.. it works perfectly for all events, but when i tried it on splunk for extraction i found out there is another format for which it is not working .&lt;/P&gt;&lt;P&gt;it looks same as event 1, but there is no space between ":" Should i be adding one more | and try it out?&lt;/P&gt;&lt;P&gt;"faultDescription":"No results found for the given ICCID."&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583356#M203132</guid>
      <dc:creator>BT</dc:creator>
      <dc:date>2022-02-02T10:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583361#M203135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242695"&gt;@BT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^((\&amp;lt;soafault:faultDescription\&amp;gt;)|(\"faultDescription\"\s*:\s*\"))(?&amp;lt;faultDescription&amp;gt;[^\"\&amp;lt;]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UR6ETx/2" target="_blank"&gt;https://regex101.com/r/UR6ETx/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:44:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583361#M203135</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-02T10:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583363#M203137</link>
      <description>&lt;P&gt;Works like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thanks a lot for the quick resolution&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583363#M203137</guid>
      <dc:creator>BT</dc:creator>
      <dc:date>2022-02-02T10:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583366#M203138</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242695"&gt;@BT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated ;.)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 11:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583366#M203138</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-02T11:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583377#M203142</link>
      <description>&lt;P&gt;There is another format . Sorry for missing it out in the begining.&lt;/P&gt;&lt;P&gt;&amp;lt;faultDescription&amp;gt;Backend system error has occurred.&amp;lt;/faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i remove&amp;nbsp;&amp;lt;&lt;STRONG&gt;soafault&lt;/STRONG&gt;:faultDescription\&amp;gt; and replace it with * and write the rex as "((\&amp;lt;*faultDescription\&amp;gt;)|(\"faultDescription\"\s*:\s*\"))(?&amp;lt;faultDescription&amp;gt;[^\"\&amp;lt;]+), then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;soafault:faultDescription&amp;gt;Backend system error has occurred.&amp;lt;/soafault:faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;is not considered.&lt;/P&gt;&lt;P&gt;1.&amp;lt;soafault:faultDescription&amp;gt;SKU is not provided&amp;lt;/soafault:faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;2."faultDescription" : "Backend system error has occurred."&lt;/P&gt;&lt;P&gt;3.&amp;lt;faultDescription&amp;gt;Backend system error has occurred.&amp;lt;/faultDescription&amp;gt;&lt;/P&gt;&lt;P&gt;4."faultDescription":"No results found for the given ICCID."&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 12:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583377#M203142</guid>
      <dc:creator>BT</dc:creator>
      <dc:date>2022-02-02T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583391#M203148</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242695"&gt;@BT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^((\&amp;lt;soafault:faultDescription\&amp;gt;)|(\"faultDescription\"\s*:\s*\")|(\&amp;lt;faultDescription\&amp;gt;))(?&amp;lt;faultDescription&amp;gt;[^\"\&amp;lt;]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UR6ETx/3" target="_blank"&gt;https://regex101.com/r/UR6ETx/3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 13:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583391#M203148</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-02T13:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: different format field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583393#M203150</link>
      <description>&lt;P&gt;Thank you.. It works !!!!!!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 13:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/different-format-field-extraction-using-rex/m-p/583393#M203150</guid>
      <dc:creator>BT</dc:creator>
      <dc:date>2022-02-02T13:34:32Z</dc:date>
    </item>
  </channel>
</rss>

