<?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: Field Extraction with Dynamic Data Structure (Field/Value Pair) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617215#M214491</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your quick response, but any of them I cannot use in In-Line field extraction available in SPLUNK web.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 22:52:26 GMT</pubDate>
    <dc:creator>SplunkDash</dc:creator>
    <dc:date>2022-10-14T22:52:26Z</dc:date>
    <item>
      <title>Field Extraction with Dynamic Data Structure (Field/Value Pair)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617211#M214487</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a data source with dynamic structure, position of comma separated field/value changes for some of the events. A few sample events and the extraction I used are giving below. My extraction is working for event one, but not working for other 2 events as field/values position changes there. Is there any way we can use one field extraction code to address this issue will be highly appreciated. Thank you so much.&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN&gt;:(?P&amp;lt;TIME_STAMP&amp;gt;.+),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Type&lt;/SPAN&gt;&lt;SPAN&gt;:(?P&amp;lt;TYPE&amp;gt;.+),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;EType&lt;/SPAN&gt;&lt;SPAN&gt;:(?P&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;EType&lt;/SPAN&gt;&lt;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t;&lt;SPAN&gt;RCode&lt;/SPAN&gt;&lt;SPAN&gt;: (?P&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;RCode&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;gt;.+),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Error&lt;/SPAN&gt;&lt;SPAN&gt;: (?P&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Error&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;gt;.+)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN&gt;2022-10-12 06:42:36.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:39.591Z, eSignCode: 3012, Type: REGT, EType: ESIGN, TCode: 23005, EventId: GET_SIGN, Id: 12045, SAddress: 35.168.40.67, &amp;nbsp;System: EIVES, SId: =/=S()A.b(X(-yJrV/+do)f(Q_)uca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===,&amp;nbsp; RCode: 000, Error: nullm&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN&gt;2022-10-12 06:42:30.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:30.591Z, Type: REGT, TCode: 23305,&amp;nbsp; Id: 12045, SAddress: 35.168.40.67, System: EIVES, SId: =/=S()A.b(X(-yJrV/+do)f(Q_)uca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===, eSignCode: 3012, EventId: GET_SIGN, Error: nullm&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN&gt;2022-10-14 06:42:26.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:26.591Z, Type: REGT, TCode: 23015, EventId: GET_SIGN, RCode: 010, Id: 12045, SAddress: 35.168.40.65, System: EIVES, SId: =/=S()A.b(X(-yJrV/98do)f(Q_)tca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===, EventId: GET_SIGN,&amp;nbsp; Error: nullm&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 14:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617211#M214487</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-10-17T14:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617212#M214488</link>
      <description>&lt;P&gt;I would recommend breaking up your rex statement into a few different regexes. This way, you can anchor on the items that are closer to the data you want to extract.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "&amp;lt;TYPE regex here&amp;gt;"
| rex field=_raw "&amp;lt;EType regex here&amp;gt;"
| rex field=_raw "&amp;lt;TCode regex here&amp;gt;"
etc. &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively you can construct 2 or 3 large regexes that can accommodate the different event structures you have, and in each regex, call the fields slightly different names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I.E. Regex 1 would extract TCode1, and regex 2 would extract TCode2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can use the eval command with the coalesce function to merge these fields together later on to TCode.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval TCode=coalesce(Tcode1,TCode2)  &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Oct 2022 21:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617212#M214488</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2022-10-14T21:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617213#M214489</link>
      <description>&lt;P&gt;Looks like a good use case for kv extraction:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="2022-10-12 06:42:36.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:39.591Z, eSignCode: 3012, Type: REGT, EType: ESIGN, TCode: 23005, EventId: GET_SIGN, Id: 12045, SAddress: 35.168.40.67,  System: EIVES, SId: =/=S()A.b(X(-yJrV/+do)f(Q_)uca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===,  RCode: 000, Error: nullm"
| append [| makeresults 
| eval _raw="2022-10-12 06:42:30.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:30.591Z, Type: REGT, TCode: 23305,  Id: 12045, SAddress: 35.168.40.67, System: EIVES, SId: =/=S()A.b(X(-yJrV/+do)f(Q_)uca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===, eSignCode: 3012, EventId: GET_SIGN, Error: nullm"]
| append [| makeresults 
| eval _raw="   2022-10-14 06:42:26.591 { INFO } [default task-79] - Timestamp: 2022-10-12T11:42:26.591Z, Type: REGT, TCode: 23015, EventId: GET_SIGN, RCode: 010, Id: 12045, SAddress: 35.168.40.65, System: EIVES, SId: =/=S()A.b(X(-yJrV/98do)f(Q_)tca-/6+o_v.k|39OYc+Fh_=YOX-iDA++===, EventId: GET_SIGN,  Error: nullm"]
| extract pairdelim=",",kvdelim=":"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 22:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617213#M214489</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-14T22:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617215#M214491</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your quick response, but any of them I cannot use in In-Line field extraction available in SPLUNK web.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 22:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617215#M214491</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-10-14T22:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617269#M214515</link>
      <description>&lt;P&gt;This is confusing. &amp;nbsp;Why cannot field-by-field extraction (as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/115292"&gt;@jdunlea&lt;/a&gt;&amp;nbsp;suggested) be used in inline field extraction? &amp;nbsp;You just enter them one by one&lt;/P&gt;&lt;P&gt;For timestamp, enter&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Timestamp:\s*(?P&amp;lt;TIME_STAMP&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;P&gt;Similarly, enter&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Type:\s*(?P&amp;lt;TYPE&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"EType:\s*(?P&amp;lt;EType&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"TCode:\s*(?P&amp;lt;TCode&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"EventId:\s*(?P&amp;lt;EventId&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"Id:\s*(?P&amp;lt;Id&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"SAddress:\s*(?P&amp;lt;SAddress&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"System:\s*(?P&amp;lt;System&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"SId:\s*(?P&amp;lt;SId&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"eSignCode:\s*(?P&amp;lt;eSignCode&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;"RCode:\s*(?P&amp;lt;RCode&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Error:\s*(?P&amp;lt;Error&amp;gt;[^,]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 04:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617269#M214515</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-16T04:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617280#M214519</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Yes, we can use that approach, go with field by field. But sometime source fields are created dynamically, and, in that case, we don't know the field value pairs; also, we need to create around 10 to 12 separate extractions. How would we address that? Thank you again.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 18:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617280#M214519</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-10-16T18:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617285#M214523</link>
      <description>&lt;P&gt;That is where&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;'s suggestion comes to play.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| extract pairdelim=",",kvdelim=":"&lt;/LI-CODE&gt;&lt;P&gt;In search line, of course, not automatic. &amp;nbsp;Also, it doesn't work with Timestamp field. &amp;nbsp;If your developers refuse to maintain an agreed-upon log format - yes, I know that happens, you are left with few choices.&lt;/P&gt;&lt;P&gt;Speaking of log format, the existing format is regular enough that they could have simply used "=" instead of ":" and you would have no problem of this sort. &amp;nbsp;It may be worth exerting any influence that you can.&lt;/P&gt;&lt;P&gt;In the meantime, you can put either johnhua's or&amp;nbsp;jdunlea's solution in a macro and insert it whenever needed.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 22:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617285#M214523</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-16T22:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617286#M214524</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you so much again and sounds good to me. I have one more question, is there any way we can use props and transforms configurations to implement this extraction?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 23:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617286#M214524</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2022-10-16T23:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction with Dynamic Data Structure (Field/Value Pair)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617292#M214529</link>
      <description>&lt;P&gt;If there is any, I haven't found it. (And not for lack of trying.) &amp;nbsp;You can still extract individual fields automatically as&amp;nbsp;jdunlea&amp;nbsp;suggested.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 00:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-with-Dynamic-Data-Structure-Field-Value-Pair/m-p/617292#M214529</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-17T00:48:11Z</dc:date>
    </item>
  </channel>
</rss>

