<?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: How to extract key value pairs from my sample data and have the output in JSON format? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270040#M81265</link>
    <description>&lt;P&gt;We have an application that need this information in json format. We don't have the luxury to change the logging application to log in json format.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2016 04:17:51 GMT</pubDate>
    <dc:creator>bharat1478</dc:creator>
    <dc:date>2016-02-05T04:17:51Z</dc:date>
    <item>
      <title>How to extract key value pairs from my sample data and have the output in JSON format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270037#M81262</link>
      <description>&lt;P&gt;I have a log that looks like this (with lot more fields):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;04FEB2016_18:05:49.440 10789:1 INFO Struct='SListmanTskSubTranV6' IO='O' EventId=17086 Event='LISTMAN_UPDATE_FOR_EXEC_RPT  REPORT' Order=1094966 To='MULT' ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract events like these from Splunk and want the output to be a &lt;STRONG&gt;VALID&lt;/STRONG&gt; json object. So in this case, output should look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"Struct":'SListmanTskSubTranV6', "IO":'O', "EventId":17086, "Event":'LISTMAN_UPDATE_FOR_EXEC_RPT  REPORT', "Order":1094966, "To":'MULT'}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to achieve this in Splunk? Our string field values can have spaces or characters like &lt;CODE&gt;'&lt;/CODE&gt;, &lt;CODE&gt;"&lt;/CODE&gt;, &lt;CODE&gt;\&lt;/CODE&gt;, etc. in it&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 23:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270037#M81262</guid>
      <dc:creator>bharat1478</dc:creator>
      <dc:date>2016-02-04T23:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from my sample data and have the output in JSON format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270038#M81263</link>
      <description>&lt;P&gt;Why? Do you want to use Splunk as a log format converter!?&lt;BR /&gt;
You can probably do that with a bunch of eval statements, but it won't be pretty.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 00:13:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270038#M81263</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2016-02-05T00:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from my sample data and have the output in JSON format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270039#M81264</link>
      <description>&lt;P&gt;See below link for different option to export search results (including json format)&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Exportsearchresults#Choose_your_export_format"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Exportsearchresults#Choose_your_export_format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 03:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270039#M81264</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-05T03:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from my sample data and have the output in JSON format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270040#M81265</link>
      <description>&lt;P&gt;We have an application that need this information in json format. We don't have the luxury to change the logging application to log in json format.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 04:17:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270040#M81265</guid>
      <dc:creator>bharat1478</dc:creator>
      <dc:date>2016-02-05T04:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from my sample data and have the output in JSON format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270041#M81266</link>
      <description>&lt;P&gt;We have a python service that is using REST API to query splunk. We want to get raw data from splunk in json format even though our actual log is in key=value format. &lt;BR /&gt;
Looks like above documentation doesn't achieve that.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 04:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-key-value-pairs-from-my-sample-data-and-have-the/m-p/270041#M81266</guid>
      <dc:creator>bharat1478</dc:creator>
      <dc:date>2016-02-05T04:24:29Z</dc:date>
    </item>
  </channel>
</rss>

