<?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 to use the field extraction expression directly using a Rex command ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701156#M237870</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;,&amp;nbsp;could you pls avoid creating duplicate posts&lt;BR /&gt;on your yesterday's post, could you pls provide us some more suggestions, details.. then troubleshooting your issue will become easier. thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2024 07:47:58 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2024-10-07T07:47:58Z</dc:date>
    <item>
      <title>How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701152#M237867</link>
      <description>&lt;P&gt;Hi Team&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please let me know how can i use the below Field extraction formula directly using the rex command ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Field extraction formula :&amp;nbsp;&lt;BR /&gt;^(?:[^,\n]*,){7}\s+"\w+_\w+_\w+_\w+_\w+":\s+"(?P&amp;lt;POH&amp;gt;[^"]+)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Real_captain_0-1728286145559.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32973iD420030826171524/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Real_captain_0-1728286145559.png" alt="Real_captain_0-1728286145559.png" /&gt;&lt;/span&gt;&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;</description>
      <pubDate>Mon, 07 Oct 2024 07:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701152#M237867</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-10-07T07:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701156#M237870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;,&amp;nbsp;could you pls avoid creating duplicate posts&lt;BR /&gt;on your yesterday's post, could you pls provide us some more suggestions, details.. then troubleshooting your issue will become easier. thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 07:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701156#M237870</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2024-10-07T07:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701157#M237871</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;This one is actually a bit different from those two yesterday's threads I merged into one.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;Inline extractions must use named capture groups which directly translate to extracted fields (with transform-based extractions you can use numbered capture groups to define fields).&lt;/P&gt;&lt;P&gt;So you can simply do&lt;/P&gt;&lt;PRE&gt;| rex "your_regex_here"&lt;/PRE&gt;&lt;P&gt;With just one caveat. Since the argument to rex command is a string you have to properly escape all necessary characters (mostly quotes and backslashes).&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 08:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701157#M237871</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-07T08:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701160#M237872</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am getting below error while using the expression with the rex command:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| rex "^(?:[^,\n]*,){7}\s+"\w+_\w+_\w+_\w+_\w+":\s+"(?P&amp;lt;POH&amp;gt;[^"]+)"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Real_captain_0-1728291517363.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32974iAF8BD097CB16323C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Real_captain_0-1728291517363.png" alt="Real_captain_0-1728291517363.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in 'SearchParser': Missing a search command before '^'. Error at position '161' of search query 'search index="events_prod_val_ssip_esa" sourcetype...{snipped} {errorcontext = "(?P&amp;lt;POH&amp;gt;[^"]+)"}'.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 08:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701160#M237872</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-10-07T08:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701162#M237873</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;&amp;nbsp;, troubleshooting a rex command is often a difficult task.&amp;nbsp;&lt;BR /&gt;Particularly when we dont know what is the issue itself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;to understand the error msg (search command required before "^"...), if you could copy paste a sample log line, that would be great (remove sensitive details like hostnames, ip address, etc).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;maybe try this step by step troubleshooting..&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;first this rex command:
| rex "(?P&amp;lt;POH&amp;gt;[^"]+)" | table POH

then second this rex command:
| rex "\w+_\w+_\w+_\w+_\w+":\s+"(?P&amp;lt;POH&amp;gt;[^"]+)" | table POH

at last, this rex command:
| rex "^(?:[^,\n]*,){7}\s+"\w+_\w+_\w+_\w+_\w+":\s+"(?P&amp;lt;POH&amp;gt;[^"]+)" | table POH&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 09:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701162#M237873</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2024-10-07T09:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701164#M237874</link>
      <description>&lt;P&gt;As I said - you have to escape the sensitive characters within the string argument. Which means that instead of single backslash you have to use two backslashes, instead of just a quote you need an escaped quote (backslash quote).&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 09:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701164#M237874</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-07T09:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701167#M237875</link>
      <description>&lt;P&gt;Hi @&lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737" target="_self"&gt;&lt;SPAN class=""&gt;inventsekar&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;Error is faced with the first rex command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Real_captain_0-1728293769789.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32975i467107A9EA826DBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Real_captain_0-1728293769789.png" alt="Real_captain_0-1728293769789.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 09:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701167#M237875</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-10-07T09:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the field extraction expression directly using a Rex command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701189#M237878</link>
      <description>&lt;P&gt;As it has already said you must escape all special characters!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| rex "(?P&amp;lt;POH&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;should fix this one. Just do rest with same way.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 11:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-field-extraction-expression-directly-using-a-Rex/m-p/701189#M237878</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-10-07T11:07:02Z</dc:date>
    </item>
  </channel>
</rss>

