<?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 value from json in props.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-value-from-json-in-props-conf/m-p/691510#M115016</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241735"&gt;@Poojitha&lt;/a&gt;&amp;nbsp;following the example from the documentation on&amp;nbsp;&lt;STRONG&gt;spath&lt;/STRONG&gt;:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.1/SearchReference/Spath#3:_Extract_and_expand_JSON_events_with_multi-valued_fields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.1/SearchReference/Spath#3:_Extract_and_expand_JSON_events_with_multi-valued_fields&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is a runanywhere example:&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{
\"Tag\": [
    {\"Key\": \"app\", \"Value\": \"test_value\"}, 
    {\"Key\": \"key1\", \"Value\": \"value1\"}, 
    {\"Key\": \"key2\", \"Value\": \"value2\"},  
    {\"Key\": \"email\", \"Value\": \"test@abc.com\"},
  ]
}
"
| spath
| rename Tag{}.Key as key, Tag{}.Value as value
| eval x=mvzip(key,value)
| mvexpand x
| eval x=split(x,",")
| eval key=mvindex(x,0)
| eval value=mvindex(x,1)
| table _time key value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2024 06:07:13 GMT</pubDate>
    <dc:creator>KendallW</dc:creator>
    <dc:date>2024-06-25T06:07:13Z</dc:date>
    <item>
      <title>Extract value from json in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-value-from-json-in-props-conf/m-p/690896#M114937</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I want to extract email&amp;nbsp; from json event in splunk.&lt;BR /&gt;&lt;BR /&gt;Query I am using is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=*sec sourcetype=test
| eval tags_json=spath(_raw, "Tag{}"), final_tag_json=json_object()
| foreach mode=multivalue tags_json [ | eval final_tag_json=json_set(final_tag_json, spath('&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;', "Key"), spath('&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;', "Value"))]
| spath input=final_tag_json
| rex field=Email "(?&amp;lt;email&amp;gt;^\w+@abc.com$)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Raw data :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Tag": [{"Key": "app", "Value": “test”_value}, {"Key": "key1", "Value": "value1"}, {"Key": "key2", "Value": "value2"},  {"Key": “email”, "Value": “test@abc.com}],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want email to be mapped to contact when indexed. How can I achieve this ? Please help me&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;pnv&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 12:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-value-from-json-in-props-conf/m-p/690896#M114937</guid>
      <dc:creator>Poojitha</dc:creator>
      <dc:date>2024-06-17T12:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from json in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-value-from-json-in-props-conf/m-p/691510#M115016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241735"&gt;@Poojitha&lt;/a&gt;&amp;nbsp;following the example from the documentation on&amp;nbsp;&lt;STRONG&gt;spath&lt;/STRONG&gt;:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.1/SearchReference/Spath#3:_Extract_and_expand_JSON_events_with_multi-valued_fields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.1/SearchReference/Spath#3:_Extract_and_expand_JSON_events_with_multi-valued_fields&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is a runanywhere example:&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{
\"Tag\": [
    {\"Key\": \"app\", \"Value\": \"test_value\"}, 
    {\"Key\": \"key1\", \"Value\": \"value1\"}, 
    {\"Key\": \"key2\", \"Value\": \"value2\"},  
    {\"Key\": \"email\", \"Value\": \"test@abc.com\"},
  ]
}
"
| spath
| rename Tag{}.Key as key, Tag{}.Value as value
| eval x=mvzip(key,value)
| mvexpand x
| eval x=split(x,",")
| eval key=mvindex(x,0)
| eval value=mvindex(x,1)
| table _time key value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 06:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-value-from-json-in-props-conf/m-p/691510#M115016</guid>
      <dc:creator>KendallW</dc:creator>
      <dc:date>2024-06-25T06:07:13Z</dc:date>
    </item>
  </channel>
</rss>

