<?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: help me rex extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225277#M66437</link>
    <description>&lt;P&gt;i am done thanks&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2016 18:15:08 GMT</pubDate>
    <dc:creator>sravankaripe</dc:creator>
    <dc:date>2016-11-10T18:15:08Z</dc:date>
    <item>
      <title>help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225271#M66431</link>
      <description>&lt;P&gt;i want to extract the fields and values where field name start with dv_ . Please help me with field extraction on this case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;endpoint="https://xyz.com/",dv_activity_due="UNKNOWN",calendar_stc="1231961",approval="not requested",dv_urgency="4 - Low",u_department="",dv_u_category="None",opened_by="frsjytyghngfchyghgmhhmhmhj",dv_u_caused_by="None",dv_u_software_model="",closed_at="2016-11-09 21:24:09",activity_due="",dv_number="INC123456",urgency="7",dv_sys_created_on="2016-10-26 10:11:28",service_offering="",dv_service_offering="",dv_upon_reject="Cancel all future Tasks",parent="",work_notes="",parent_incident="",u_territory="",dv_u_area="None",u_loc_code="",dv_sys_tags="",dv_follow_up="",dv_u_node="",u_caller_phone="(000) 000-0000",dv_cmdb_ci="",dv_u_vendor="IBM",work_notes_list="",priority="5",upon_approval="proceed",dv_notify="Do Not Notify",comments="",dv_approval="Not Yet Requested",dv_watch_list="st-store0509.allmanager@kohls.com",dv_u_loc_code="",dv_business_stc="303,849",sys_created_by="eci_mtsa",reopen_count="0",dv_sys_updated_on="2016-11-09 15:24:09",dv_due_date="",dv_expected_start="",dv_sys_domain="global",correlation_id="L17SRR",impact="7",dv_time_worked="10 Minutes",dv_opened_by="MTSA Integration",u_caused_by="",u_ess_visibility="true",approval_set="",contract="",watch_list="st-user@company.com",additional_assignee_list="",dv_work_notes="2016-11-09 12:12:25 - MTSA Integration (Work notes)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Nov 2016 21:49:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225271#M66431</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2016-11-09T21:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225272#M66432</link>
      <description>&lt;P&gt;Splunk should automatically extract key=value pairs in search time. Have you tried searching in Verbose mode first? (As long as KV_MODE=auto for the sourcetype)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 22:12:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225272#M66432</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2016-11-09T22:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225273#M66433</link>
      <description>&lt;P&gt;i tried it. it dose not retrieving all the values.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 22:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225273#M66433</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2016-11-09T22:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225274#M66434</link>
      <description>&lt;P&gt;Try this, where sed is used first to replace any blank values &lt;CODE&gt;\"\"&lt;/CODE&gt; in the dv_fields with a word &lt;CODE&gt;"Blank"&lt;/CODE&gt; and the fields are extracted thereafter:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourQuery to return the entire string in field stringValue
| rex mode=sed field=stringValue "s/\"\"/\"Blank\"/g"
| rex field=stringValue max_match=0 "(?&amp;lt;dvFieldName&amp;gt;(dv_[^=]+))\=\"*(?&amp;lt;dvFieldValue&amp;gt;[^\"]+)"
| eval kvPair=mvzip(dvFieldName, dvFieldValue, "~")
| mvexpand kvPair
| rex field=kvPair "(?&amp;lt;myField&amp;gt;[^~]+)\~(?&amp;lt;myValue&amp;gt;[^$]+)"
| table myField, myValue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Trial example to test the above query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults| eval stringValue="endpoint=\"https://xyz.com/\",dv_activity_due=\"UNKNOWN\",calendar_stc=\"1231961\",approval=\"not requested\",dv_urgency=\"4 - Low\",u_department=\"\",dv_u_category=\"None\",opened_by=\"frsjytyghngfchyghgmhhmhmhj\",dv_u_caused_by=\"None\",dv_u_software_model=\"\",closed_at=\"2016-11-09 21:24:09\",activity_due=\"\",dv_number=\"INC123456\",urgency=\"7\",dv_sys_created_on=\"2016-10-26 10:11:28\",service_offering=\"\",dv_service_offering=\"\",dv_upon_reject=\"Cancel all future Tasks\",parent=\"\",work_notes=\"\",parent_incident=\"\",u_territory=\"\",dv_u_area=\"None\",u_loc_code=\"\",dv_sys_tags=\"\",dv_follow_up=\"\",dv_u_node=\"\",u_caller_phone=\"(000) 000-0000\",dv_cmdb_ci=\"\",dv_u_vendor=\"IBM\",work_notes_list=\"\",priority=\"5\",upon_approval=\"proceed\",dv_notify=\"Do Not Notify\",comments=\"\",dv_approval=\"Not Yet Requested\",dv_watch_list=\"st-store0509.allmanager@kohls.com\",dv_u_loc_code=\"\",dv_business_stc=\"303,849\",sys_created_by=\"eci_mtsa\",reopen_count=\"0\",dv_sys_updated_on=\"2016-11-09 15:24:09\",dv_due_date=\"\",dv_expected_start=\"\",dv_sys_domain=\"global\",correlation_id=\"L17SRR\",impact=\"7\",dv_time_worked=\"10 Minutes\",dv_opened_by=\"MTSA Integration\",u_caused_by=\"\",u_ess_visibility=\"true\",approval_set=\"\",contract=\"\",watch_list=\"st-store0509.allmanager@kohls.com\",additional_assignee_list=\"\",dv_work_notes=\"2016-11-09 12:12:25 - MTSA Integration (Work notes)\""
| rex mode=sed field=stringValue "s/\"\"/\"Blank\"/g"
| rex field=stringValue max_match=0 "(?&amp;lt;dvFieldName&amp;gt;(dv_[^=]+))\=\"(?&amp;lt;dvFieldValue&amp;gt;[^\"]*)"
| eval kvPair=mvzip(dvFieldName, dvFieldValue, "~")
| mvexpand kvPair
| rex field=kvPair "(?&amp;lt;myField&amp;gt;[^~]+)\~(?&amp;lt;myValue&amp;gt;[^$]+)"
| table myField, myValue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Nov 2016 23:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225274#M66434</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-09T23:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225275#M66435</link>
      <description>&lt;P&gt;Hi  sravankaripe,&lt;BR /&gt;
Splunk recognize fields at search time when there is an equal (=) between field name and field value, so you can have without any activity al the fields and values.&lt;/P&gt;

&lt;P&gt;I don't understand in your question, if you need to extract field names or field values.&lt;BR /&gt;
If you need field names, you can use the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;field_name&amp;gt;dv_[^\=]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if instead you want to have the values of all fields, you could use the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;dv_[^\=]*\=\"(?&amp;lt;field_name&amp;gt;[^\"]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 11:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225275#M66435</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-10T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225276#M66436</link>
      <description>&lt;P&gt;i want to dispaly attribute name also like&lt;/P&gt;

&lt;H2&gt;ex:-&lt;/H2&gt;

&lt;P&gt;dv_activity_due = value1&lt;BR /&gt;
dv_approval = value2&lt;BR /&gt;
dv_business_duration = value3&lt;BR /&gt;
dv_business_service  = value4&lt;BR /&gt;
dv_business_stc   = value5 &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225276#M66436</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2020-09-29T11:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: help me rex extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225277#M66437</link>
      <description>&lt;P&gt;i am done thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 18:15:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-rex-extraction/m-p/225277#M66437</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2016-11-10T18:15:08Z</dc:date>
    </item>
  </channel>
</rss>

