<?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: | rex command to extract a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646444#M223750</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257610"&gt;@adhwihhiahwd&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I suppose that yu tested yur regex in regex101.com and it runs but it doesn't run in Splunk,&lt;/P&gt;&lt;P&gt;so, try using four back slashes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "httpStatus\\\\":(?&amp;lt;http_status&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 13:05:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-06-09T13:05:45Z</dc:date>
    <item>
      <title>Help with | rex command to extract a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646442#M223749</link>
      <description>&lt;P&gt;hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my event data looks like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{\"status\":1,\"httpStatus\":200,\"event\":\"getBooks\"}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to extract httpStatus as a field so I can filter events by their codes(e.g 200, 400 ..)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I learned that we need to escape backslashes and double quotes but the command below didn't work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex "httpStatus\\\":(?&amp;lt;http_status&amp;gt;\d+)"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What did i do incorrectly here?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646442#M223749</guid>
      <dc:creator>adhwihhiahwd</dc:creator>
      <dc:date>2023-06-09T14:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: | rex command to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646444#M223750</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257610"&gt;@adhwihhiahwd&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I suppose that yu tested yur regex in regex101.com and it runs but it doesn't run in Splunk,&lt;/P&gt;&lt;P&gt;so, try using four back slashes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "httpStatus\\\\":(?&amp;lt;http_status&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 13:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646444#M223750</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-09T13:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: | rex command to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646445#M223751</link>
      <description>&lt;P&gt;wow thanks!&lt;/P&gt;&lt;P&gt;4 back slashes worked...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "httpStatus\\\\\":(?&amp;lt;http_status&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 13:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646445#M223751</guid>
      <dc:creator>adhwihhiahwd</dc:creator>
      <dc:date>2023-06-09T13:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: | rex command to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646446#M223752</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257610"&gt;@adhwihhiahwd&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Splunk mysteries!!!&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;let me know if I can help you more, or, please, accept one answer for the other people of Community.&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;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 13:11:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-command-to-extract-a-field/m-p/646446#M223752</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-09T13:11:16Z</dc:date>
    </item>
  </channel>
</rss>

