<?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 fields in JSON during index time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261219#M50121</link>
    <description>&lt;P&gt;Someone kindly help me write the regex for source n tag .. I'm finding it very difficult to frame since it's new to me.. &lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2016 16:07:57 GMT</pubDate>
    <dc:creator>sarnagar</dc:creator>
    <dc:date>2016-10-20T16:07:57Z</dc:date>
    <item>
      <title>Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261217#M50119</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;
I'm a newbie to splunk in field extractions. Appreciate any help on this.&lt;BR /&gt;
I have JSON Format logs like below:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2032iC8EB6C388092F586/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want source and tag as a field i.e it should not appear in events instead as separate fields like the way default fields appear on the left hand side in UI. Also I want the word "line:" to be removed. so basically only my line event should appear in splunk. How can I achieve this?&lt;BR /&gt;
I believe props.conf and transforms should be a solution. But I dont know how to approach that. My transforms should contain a regex to capture what? I'm not understandin what my regex should do?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 10:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261217#M50119</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2016-10-20T10:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261218#M50120</link>
      <description>&lt;P&gt;RAW DATA:&lt;/P&gt;

&lt;P&gt;{"line":"[ERROR   ] CWWKS9660E: The orb element with the defaultOrb id attribute requires a user registry but no user registry became available within 10 seconds.   As a result, no application will start. Ensure that you have configured an appropriate user registry in the server.xml file.","source":"stderr","tag":"itec-artifactory.fmr.com:6555/com.fmr.pl000123.demo.actionate:0.0.1-14/Actionate_DEV_ACTIONATE.1.385y3873nb5k4m7xsmwxokgum/92e6e10df174"}&lt;BR /&gt;
{"line":"[AUDIT   ] CWWKS4104A: LTPA keys created in 1.184 seconds. LTPA key file: /opt/ibm/wlp/output/defaultServer/resources/security/ltpa.keys","source":"stdout","tag":"itec-artifactory.fmr.com:6555/com.fmr.pl000123.demo.actionate:0.0.1-14/Actionate_DEV_ACTIONATE.1.385y3873nb5k4m7xsmwxokgum/92e6e10df174"}&lt;BR /&gt;
{"line":"[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. ","source":"stdout","tag":"itec-artifactory.fmr.com:6555/com.fmr.pl000123.demo.actionate:0.0.1-14/Actionate_DEV_ACTIONATE.1.385y3873nb5k4m7xsmwxokgum/92e6e10df174"}&lt;BR /&gt;
{"line":"[ERROR   ] CWWKG0074E: Unable to update the configuration for jndiReferenceEntry with the unique identifier customDataSourceFactoryEntry because of the exception: The value jdbc/actionateDB for attribute jndiName is not unique.","source":"stderr","tag":"itec-artifactory.fmr.com:6555/com.fmr.pl000123.demo.actionate:0.0.1-14/Actionate_DEV_ACTIONATE.1.385y3873nb5k4m7xsmwxokgum/92e6e10df174"}&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261218#M50120</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2020-09-29T11:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261219#M50121</link>
      <description>&lt;P&gt;Someone kindly help me write the regex for source n tag .. I'm finding it very difficult to frame since it's new to me.. &lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 16:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261219#M50121</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2016-10-20T16:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261220#M50122</link>
      <description>&lt;P&gt;I don't believe you'll need any regex according to what i'm seeing.  Or perhaps i don't understand exactly what you want to display.  I am using the lastest Splunk 6.5 and this is what I get when i ingest your events and assign _json as the sourcetype.  That is simply the raw event viewer.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2029i09DD6387E222E600/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The fields are being created properly.  Look at the left side in the above screenshot to see those extracted fields.  Then, below  then you can simply use the table command to display the data how you'd like to see it.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2030i134679CE7BA3F3B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261220#M50122</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-21T15:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261221#M50123</link>
      <description>&lt;P&gt;Hi @sdaniels ,&lt;/P&gt;

&lt;P&gt;I did that. But I don't want source and tag to be displayed in events. They should be as only fields on the left side.&lt;BR /&gt;
Is that possible?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 17:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261221#M50123</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2016-10-21T17:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261222#M50124</link>
      <description>&lt;P&gt;Wasn't posting in the comments section so responding to your comment here.&lt;/P&gt;

&lt;P&gt;Sure.  Why do you want it out of the raw event if it doesn't affect your searching and viewing of the data the way that you want it?   In props.conf you can use the command: SEDCMD&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Data/Anonymizedatausingconfigurationfiles#Anonymize_data_through_a_sed_script"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/Data/Anonymizedatausingconfigurationfiles#Anonymize_data_through_a_sed_script&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The link above shows how to anonymize data using a SED script. Pattern match and replace it etc... In your case, you replace it with nothing.  If you do this, you may then have to create regex to pull out the source and tag fields manually though, not sure.  Right now the _json format is taking care of that for you.  Try it out.  Use Regexr.com and you can play with RegEx matching if you need to change anything.&lt;/P&gt;

&lt;P&gt;Something like this in prop.conf to remove source and then similar for tag- &lt;BR /&gt;
SEDCMD - dumpsrc = \,\"source\"://g&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 17:23:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261222#M50124</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-21T17:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261223#M50125</link>
      <description>&lt;P&gt;Responded below. thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 17:24:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261223#M50125</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-21T17:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261224#M50126</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43393"&gt;@sdaniels&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;Could'nt attach an image in comments section so responding&lt;BR /&gt;
 here in the answers section.&lt;BR /&gt;
Thankyou for the response. But I believe that doesn't solve our customer's requirement completely.&lt;BR /&gt;
Like you said , I can use SEDCMD to remove the word "line:" .&lt;BR /&gt;
But I want only the below highlighted ones to appear in _raw events. Is that possible? How do we achieve that?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/167175-json2.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;When I perform the search, the values of source and tag should not appear in _raw events but they should appear as only  extracted fields. &lt;/P&gt;

&lt;P&gt;I tried the below props and transforms but it doesn't seem to work. Could you please help?&lt;/P&gt;

&lt;P&gt;PROPS&lt;/P&gt;

&lt;P&gt;[httpevent]&lt;BR /&gt;
CHARSET=UTF-8&lt;BR /&gt;
INDEXED_EXTRACTIONS=json&lt;BR /&gt;
KV_MODE=none&lt;BR /&gt;
SHOULD_LINEMERGE=true&lt;BR /&gt;
category=Structured&lt;BR /&gt;
disabled=false&lt;BR /&gt;
pulldown_type=true&lt;BR /&gt;
TRANSFORMS-fields = field1,filed2&lt;/P&gt;

&lt;P&gt;TRANSFORMS&lt;/P&gt;

&lt;P&gt;[field1]&lt;BR /&gt;
REGEX = (?:[^"\n]*"){7}(?P[^"]+)&lt;BR /&gt;
FORMAT = source::$1 &lt;/P&gt;

&lt;P&gt;[field2]&lt;BR /&gt;
REGEX = (?:[^,\n]*,){2}"\w+":"(?P[^"]+)&lt;BR /&gt;
FORMAT = tag::$1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261224#M50126</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2020-09-29T11:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261225#M50127</link>
      <description>&lt;P&gt;I'm not sure what you are trying to accomplish here.   If you only want the highlighted yellow part to appear in the raw message that means you'd need to modify raw and delete the rest using the SEDCMD.  The fields that appear on the lower left of the Search page create fields that are extracted from _raw.  If you remove data from _raw, it's not available to create fields, therefore you wouldn't have fields for source and tag.  Is there a security concern here?  Is it about abstracting away complexity to the user?    Why does your customer want it done this particular way?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 13:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261225#M50127</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-24T13:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261226#M50128</link>
      <description>&lt;P&gt;Hi @sdaniels,&lt;/P&gt;

&lt;P&gt;Basically, earlier we had indexed the Dynatrace collector logs for monitoring and these logs appeared in normal  format in splunk. &lt;BR /&gt;
Now these(above images) are the Dynatrace collectors running in the Docker containers. So after these collectors are dockerized, these collector logs appear in json format. We are trying to see if we can make this json appear like the old regular non-json collector logs. Is that possible?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 07:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261226#M50128</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2016-10-25T07:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261227#M50129</link>
      <description>&lt;P&gt;You can use the SEDCMD to replace your raw event with only the highlighted part.  You lose source and tag because they wouldn't be part of the _raw message.   You could also run script on the data  before it comes into Splunk and represent the data however you'd like so it matches the old format.  &lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 16:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261227#M50129</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-25T16:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261228#M50130</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43393"&gt;@sdaniels&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;Thankyuo . But I believe I don't wanna lose data from tag and source. Else is there a way to extract more fields from the tag values like below?&lt;BR /&gt;
ORIGINAL:&lt;BR /&gt;
","tag":"itec-artifactory.fmr.com:6555/com.fmr.pl000123.demo.actionate:0.0.1-14/Actionate_DEV_ACTIONATE.1.385y3873nb5k4m7xsmwxokgum/92e6e10df174"&lt;/P&gt;

&lt;P&gt;MODIFIED:&lt;BR /&gt;
&lt;STRONG&gt;container-image&lt;/STRONG&gt;=itec-artifactory.fmr.com:6555/com.fmr.pl000123.ezpaas.ezpaas-dynatrace-collector:6.3-11,&lt;STRONG&gt;container-service&lt;/STRONG&gt;=Dynatrace_Collector_DEV-WLP_WLP.7.3hvzd4e5b5zdby4blgu1v8rm8,&lt;STRONG&gt;container-id&lt;/STRONG&gt;=5125046f7489&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261228#M50130</guid>
      <dc:creator>sarnagar</dc:creator>
      <dc:date>2020-09-29T11:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in JSON during index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261229#M50131</link>
      <description>&lt;P&gt;I would suggest posting a new question with exactly what you want to do.  The information above is nothing like the raw events you posted originally.  If you post a few raw event examples and details on what you want now, i'm sure we can get you what you need.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 12:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-fields-in-JSON-during-index-time/m-p/261229#M50131</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2016-10-26T12:11:27Z</dc:date>
    </item>
  </channel>
</rss>

