<?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: Extract Field Name and Value from Data Source using Delimiter based KV extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456114#M170527</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can achieve this using regular expression in props and transforms to extract field and value at search time.&lt;/P&gt;

&lt;P&gt;On Search Head&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourceType]
REPORT-test = extract_session_kv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_session_kv]
CLEAN_KEYS = 0
FORMAT = $1::$2
REGEX = Session_Variable_Name\=\"([^"]+)\"\,Session_Variable_Value\=\"([^"]+)\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Jul 2019 08:21:19 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2019-07-04T08:21:19Z</dc:date>
    <item>
      <title>Extract Field Name and Value from Data Source using Delimiter based KV extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456113#M170526</link>
      <description>&lt;P&gt;I'm looking to dynamically extract both the field name and the associated value from a data source.  Essentially, the field name is a session variable on F5 and these variables can be added and removed at will.  So statically trying to regex the field extraction and field name would be impossible.  Here is a data sample&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.end",Session_Variable_Value="Nov 26 22:14:03 2020 GMT"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.exist",Session_Variable_Value="1"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.issuer",Session_Variable_Value="DC=local, DC=cloudmegalodon, CN=cloudmegalodon-CMDC1-CA"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.serial",Session_Variable_Value="59:00:00:00:09:21:54:f7:30:0b:fd:f7:9f:00:00:00:00:00:09"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.start",Session_Variable_Value="Nov 27 22:14:03 2018 GMT"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.subject",Session_Variable_Value="DC=local, DC=cloudmegalodon, OU=OrgUsers, CN=TINA F. OLSON.1468013579"
hostname="ip-10-1-1-49.us-gov-west-1.compute.internal",errdefs_msgno="01490007:6:",partition_name="Common",session_id="c3da4e31",Access_Profile="/Common/testPolicy1",Partition="Common",Session_Id="c3da4e31",Session_Variable_Name="session.ssl.cert.valid",Session_Variable_Value="0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to take for example &lt;CODE&gt;Session_Variable_Name="session.ssl.cert.serial",Session_Variable_Value="59:00:00:00:09:21:54:f7:30:0b:fd:f7:9f:00:00:00:00:00:09"&lt;/CODE&gt;&lt;BR /&gt;
and make session.ssl.cert.serial the field name and 59:00:00:00:09:21:54:f7:30:0b:fd:f7:9f:00:00:00:00:00:09 the field value.&lt;/P&gt;

&lt;P&gt;I have not been able to get this to work with kv pairdelim and kvdelim.  Maybe there is a better way to do this.  Open to any and all ideas!&lt;/P&gt;

&lt;P&gt;Here is the search I'm working with now&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="test_f5" sourcetype="f5_syslog_splunk" | kv pairdelim="Session_Variable_Name\r\n" kvdelim="\",Session_Variable_Value=\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 19:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456113#M170526</guid>
      <dc:creator>jspigler2010</dc:creator>
      <dc:date>2019-07-03T19:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Field Name and Value from Data Source using Delimiter based KV extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456114#M170527</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can achieve this using regular expression in props and transforms to extract field and value at search time.&lt;/P&gt;

&lt;P&gt;On Search Head&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourceType]
REPORT-test = extract_session_kv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_session_kv]
CLEAN_KEYS = 0
FORMAT = $1::$2
REGEX = Session_Variable_Name\=\"([^"]+)\"\,Session_Variable_Value\=\"([^"]+)\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jul 2019 08:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456114#M170527</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-07-04T08:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Field Name and Value from Data Source using Delimiter based KV extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456115#M170528</link>
      <description>&lt;P&gt;Works great!  Thanks harsmarvania!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Field-Name-and-Value-from-Data-Source-using-Delimiter/m-p/456115#M170528</guid>
      <dc:creator>jspigler2010</dc:creator>
      <dc:date>2019-07-08T16:55:43Z</dc:date>
    </item>
  </channel>
</rss>

