<?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: Issue using the field extractor in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/642418#M222538</link>
    <description>&lt;P&gt;Pretty close. This one worked for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;| rex field=_raw "statement:(?&amp;lt;statement&amp;gt;[^^$]+)"&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 16:32:36 GMT</pubDate>
    <dc:creator>splunkyj</dc:creator>
    <dc:date>2023-05-05T16:32:36Z</dc:date>
    <item>
      <title>Issue using the field extractor?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319282#M95443</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm using the following search string to monitor SQL Server DB Tables that are being audited by SQL Server Audit logs and then pushed to the Application Event Logs.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;eventtype="wineventlog_application" sourcetype="*" TaskCategory="*"  SourceName="MSSQLSERVER" EventCode="33205" | eval EventCodeDescription=if(isnull(EventCodeDescription), mvindex(split(Message, "."), 0), EventCodeDescription)| rex field=_raw "statement:(?&amp;lt;statement&amp;gt;.*)\s" | rex field=_raw "database_name:(?&amp;lt;database_name&amp;gt;.*)\s" | rex field=_raw "server_instance_name:(?&amp;lt;server_instance_name&amp;gt;.*)\s" | rex field=_raw "server_principal_name:(?&amp;lt;server_principal_name&amp;gt;.*)\s" | table  _time, EventCode, EventCodeDescription, server_instance_name, server_principal_name, database_name, statement  | rename  server_instance_name as "Server Instance", server_principal_name as "Account Used", database_name as "Database", statement as "Table Modified"&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;This creates the following table:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/208639-splunk2.jpg" border="0" alt="alt text" /&gt;&lt;/P&gt;
&lt;P&gt;I'm using the following to manually create fields &lt;STRONG&gt;(In Bold)&lt;/STRONG&gt; in my search for my tables from the sample event log below.:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;| rex field=_raw "statement:(?.*)\s" &lt;BR /&gt;
| rex field=_raw "database_name:(?.*)\s" &lt;BR /&gt;
| rex field=_raw "server_instance_name:(?.*)\s"&lt;BR /&gt;
 | rex field=_raw "server_principal_name:(?.*)\s"&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;7/17/17&lt;BR /&gt;12:03:44.000 PM &lt;BR /&gt;07/17/2017 12:03:44 PM&lt;BR /&gt;LogName=Application&lt;BR /&gt;SourceName=MSSQLSERVER&lt;BR /&gt;EventCode=33205&lt;BR /&gt;EventType=0&lt;BR /&gt;Type=Information&lt;BR /&gt;ComputerName=Batman.Justiceleague.dc&lt;BR /&gt;TaskCategory=None&lt;BR /&gt;OpCode=None&lt;BR /&gt;RecordNumber=68853580&lt;BR /&gt;Keywords=Audit Success, Classic&lt;BR /&gt;Message=Audit event: event_time:2017-07-17 18:03:44.2141420&lt;BR /&gt;sequence_number:1&lt;BR /&gt;action_id:IN&lt;BR /&gt;&lt;BR /&gt;succeeded:true&lt;BR /&gt;is_column_permission:false&lt;BR /&gt;session_id:76&lt;BR /&gt;server_principal_id:403&lt;BR /&gt;database_principal_id:1&lt;BR /&gt;target_server_principal_id:0&lt;BR /&gt;target_database_principal_id:0&lt;BR /&gt;object_id:7671075&lt;BR /&gt;user_defined_event_id:0&lt;BR /&gt;class_type:U &lt;BR /&gt;permission_bitmask:00000000000000000000000000000008&lt;BR /&gt;session_server_principal_name:Batcave&lt;BR /&gt;&lt;STRONG&gt;server_principal_name&lt;/STRONG&gt;:Batman&lt;BR /&gt;server_principal_sid:a1f03f0aga235sga232437d411&lt;BR /&gt;database_principal_name:dbo&lt;BR /&gt;target_server_principal_name:&lt;BR /&gt;target_server_principal_sid:&lt;BR /&gt;target_database_principal_name:&lt;BR /&gt;&lt;STRONG&gt;server_instance_name&lt;/STRONG&gt;:DCUniverse&lt;BR /&gt;&lt;STRONG&gt;database_name&lt;/STRONG&gt;:Justice_league&lt;BR /&gt;schema_name:dbo&lt;BR /&gt;object_name:auditinfoadm&lt;BR /&gt;&lt;STRONG&gt;statement&lt;/STRONG&gt;:insert auditinfoadm (actor, actorname, dtime, event, ipaddr)&lt;BR /&gt;select @l_memberid, name, getutcdate(), 'LOGOUT', @l_ipaddr&lt;BR /&gt;from member where memberid = @l_memberid&lt;/P&gt;
&lt;P&gt;additional_information:&lt;BR /&gt;user_defined_information:&lt;/P&gt;
&lt;P&gt;I want to create some field extractions so I don't have use these commands in my search string. I have tried doing so using both the tool and by manually creating my own regex. But I think because of how short the sample event log is (as per below), the information I want at the bottom of my event log is not being searched, thus it is not creating the fields for me in the "interesting fields" column in the events tab.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/208640-splunk1.jpg" border="0" alt="alt text" /&gt;&lt;/P&gt;
&lt;P&gt;I have also tried using the "Filter" search bar to search for "server_principal_name" and this shows me the data, (while it will omit data it can't show) but it still does not create the extracted fields I want.&lt;/P&gt;
&lt;P&gt;Anyone have ideas on how I can get around this?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 18:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319282#M95443</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2023-05-05T18:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319283#M95444</link>
      <description>&lt;P&gt;Probably not the length of the event, unless it's thousands of characters long.  &lt;/P&gt;

&lt;P&gt;When you try the search_time extraction - &lt;BR /&gt;
1) Did you leave off the quotes from the regex?&lt;BR /&gt;&lt;BR /&gt;
2) Did you restart splunk?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 00:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319283#M95444</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-19T00:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319284#M95445</link>
      <description>&lt;P&gt;If you "have tried" then do show us your &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; entries.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 00:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319284#M95445</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-19T00:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319285#M95446</link>
      <description>&lt;P&gt;Hi Thanks for the reply.  I found that I had an extra \ at the end and this was causing it to not show anything.  However the problem I have now is, it is displaying everything after the line specified:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;redacted&amp;gt; database_name:&amp;lt;redacted&amp;gt; schema_name:dbo object_name:auditinfoadm statement:insert auditinfoadm (actor, actorname, dtime, event, ipaddr) select @l_memberid, name, getutcdate(), 'LOGOUT', @l_ipaddr from member where memberid = @l_memberid additional_information:&amp;lt;tsql_stack&amp;gt;&amp;lt;frame nest_level = '3' database_name = &amp;lt;redacted&amp;gt;' schema_name = 'dbo' object_name = 'usrsession_bdr'/&amp;gt;&amp;lt;/tsql_stack&amp;gt; user_defined_information:
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319285#M95446</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2017-07-31T15:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319286#M95447</link>
      <description>&lt;P&gt;/opt/splunk/etc/apps/search/local/props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog:Application]
EXTRACT-server_instance_name = server_instance_name:(?.*)\s
EXTRACT-statement = statement:(?.*)\s
EXTRACT-server_principal_name = server_principal_name:(?.*)\s
EXTRACT-database_name = database_name:(?.*)\s
[*]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't put anything in the transforms.conf&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319286#M95447</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2017-07-31T15:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319287#M95448</link>
      <description>&lt;P&gt;You are misunderstanding the way that &lt;CODE&gt;EXTRACT-&lt;/CODE&gt; works, assuming that it is like &lt;CODE&gt;EVAL-&lt;/CODE&gt; in that the portion following the hyphen is the name of the field: it is not!  You need to specify the field name inside the RegEx string so try something like this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog:Application]
EXTRACT-server_instance_name = server_instance_name:(?&amp;lt;server_instance_name&amp;gt;\S+)
EXTRACT-statement = statement:(?&amp;lt;statement&amp;gt;\S+)
EXTRACT-server_principal_name = server_principal_name:(?&amp;lt;server_principal_name&amp;gt;\S+)
EXTRACT-database_name = database_name:(?&amp;lt;database_name&amp;gt;\S+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319287#M95448</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-31T15:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319288#M95449</link>
      <description>&lt;P&gt;YES! Thank you for this clarification.  This resolved the issue I was having.  Another question if I may?&lt;/P&gt;

&lt;P&gt;The table now shows:&lt;/P&gt;

&lt;P&gt;INSERT&lt;/P&gt;

&lt;P&gt;This is fine for the other three fields.  But the "statement" shows the following, which I would also like to include: &lt;/P&gt;

&lt;P&gt;statement:INSERT INTO dbo.Ap_Invoice_Split (Ap_Invoice_Id, Inter_Company_Skey, Branch_Skey, Gl_Account_Skey, Product_Skey, Category_Skey, Description, Purchase_Order, Amount, GST_Amount) VALUES (@p0, @p1, @Anonymous, @p3, @p4, @p5, @p6, @p7, @p8, @p9); &lt;/P&gt;

&lt;P&gt;Could you also clarify for me how to include the rest of this information as per the statement above?  &lt;/P&gt;

&lt;P&gt;EXTRACT-statement = statement:(?\S+)&lt;/P&gt;

&lt;P&gt;As per my understanding of regex \S+ is for selecting "not whitespace" and matching 1 or more of the preceeding token?  Which is why it stops after seeing a blank space.  How do extend this to cover the rest of this? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319288#M95449</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2020-09-29T15:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319289#M95450</link>
      <description>&lt;P&gt;You need some kind of delimiter to use as an anchor on the end, maybe &lt;CODE&gt;(?&amp;lt;statement&amp;gt;.*?);($|[\r\n]+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 17:33:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319289#M95450</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-31T17:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319290#M95451</link>
      <description>&lt;P&gt;Don't forget to upvote all the helpful answers and click &lt;CODE&gt;Accept&lt;/CODE&gt; on the best one.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 17:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319290#M95451</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-31T17:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319291#M95452</link>
      <description>&lt;P&gt;Thanks! Your help was much appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 18:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319291#M95452</guid>
      <dc:creator>DeanDeleon0</dc:creator>
      <dc:date>2017-07-31T18:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319292#M95453</link>
      <description>&lt;P&gt;I had the same issue with the "statement" extraction. After hours of trial and error, I found the magic regex:&lt;/P&gt;

&lt;P&gt;...| rex field=_raw "statement:(?[^^$]+)additional" | ...&lt;/P&gt;

&lt;P&gt;Regex:  [^^$]+&lt;BR /&gt;
    [^^$] match anything that is not an empty line&lt;BR /&gt;
    + match multiple times&lt;/P&gt;

&lt;P&gt;Give it a try!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 10:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/319292#M95453</guid>
      <dc:creator>cdpascariu</dc:creator>
      <dc:date>2018-10-02T10:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using the field extractor</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/642418#M222538</link>
      <description>&lt;P&gt;Pretty close. This one worked for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;| rex field=_raw "statement:(?&amp;lt;statement&amp;gt;[^^$]+)"&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 16:32:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-using-the-field-extractor/m-p/642418#M222538</guid>
      <dc:creator>splunkyj</dc:creator>
      <dc:date>2023-05-05T16:32:36Z</dc:date>
    </item>
  </channel>
</rss>

