<?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 fields in a file? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378793#M111027</link>
    <description>&lt;P&gt;Hi @493669&lt;/P&gt;

&lt;P&gt;In MonitorData , there are 25 keys(itemId, docType,.....)&lt;/P&gt;

&lt;P&gt;and each key contains no of value(eg. itemId contains 100 different values) ....... can i extract each value as seprate event.&lt;BR /&gt;
like itemId, doctype.&lt;/P&gt;

&lt;P&gt;Please suggest as well. Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Aug 2018 07:12:25 GMT</pubDate>
    <dc:creator>dhirendra761</dc:creator>
    <dc:date>2018-08-01T07:12:25Z</dc:date>
    <item>
      <title>How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378782#M111016</link>
      <description>&lt;P&gt;I need to extract each filed in "monitoringdata" in file.&lt;BR /&gt;
belo is sample of data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"@timestamp":"2018-07-27T16:06:28.025+05:30","@version":1,"logger_name":"ADNSMONITOR","thread_name":"priority-all-publishrevisiondownloadthread-CSDBL-S1KD-A350-HHJ-28-Jul-2018","level":"INFO","level_value":20000,"HOSTNAME":"ITEM-S66462","startTaskManDate":"1532687732198","endDate":"","start":"","error":"","attempt":"1","jobnorm":"JB1T40R011-DOWNLOAD","duration":"","stop":"","requestId":"01f965d4-d681-4f02-a349-44870765ed10","tasknorm":"","monitoringData":"{\"deliverableType\":null,\"docType\":null,\"acProgram\":null,\"docId\":null,\"revisionDate\":null,\"format\":null,\"entity\":null,\"customersRightStatus\":null,\"customersRightEventDate\":null,\"majorEvent\":null,\"emergency\":null,\"attachmentType\":null,\"attachmentIssueDate\":null,\"acknowledgment\":null,\"acknowledgmentDate\":null,\"productionOrder\":null,\"domain\":null,\"productKey\":\"#[A350]#HHJ#CSDBL##[PN1234]##\",\"itemId\":\"260_S1KD\",\"onlineAvailabilityData\":{\"type\":\"DownloadState\",\"status\":\"InProgress\",\"fromDate\":null,\"toDate\":null},\"acksStatus\":null}","functionalKey":"CSDBL-S1KD-A350-HHJ-28-Jul-2018","startPublicationDate":"1532687732198","jobSourceId":"IM01-SRDD","status":"IN_PROGRESS","appName":"ADNS-Taskman","appEnv":"dev","appProduct":"1T40"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried so many times. but always get &lt;STRONG&gt;monitoringdata&lt;/STRONG&gt; as &lt;STRONG&gt;group of data fields.&lt;/STRONG&gt;&lt;BR /&gt;
&lt;A href="https://imgur.com/H46vjdK"&gt;link text&lt;/A&gt;&lt;BR /&gt;
I need a new field like deliverableType, docType, acProgram and so on.&lt;/P&gt;

&lt;P&gt;I am trying lot, but not succeed. Any help will be appreciated. &lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 07:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378782#M111016</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-29T07:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378783#M111017</link>
      <description>&lt;P&gt;&lt;A href="https://imgur.com/H46vjdK"&gt;https://imgur.com/H46vjdK&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 07:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378783#M111017</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-29T07:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378784#M111018</link>
      <description>&lt;P&gt;@dhirendra761, can you try below-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| rex max_match=0 field=monitoringdata "(?&amp;lt;key&amp;gt;\w+)\":\"?(?&amp;lt;value&amp;gt;\"?[^,\"]+)"|table key, value|eval b=mvzip(key,value)|mvexpand b| makemv b delim=","|eval key=mvindex(b, 0)| eval value=mvindex(b, 1)|table key value| transpose 0 header_field=key
 | fields - column
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try this run anywhere search query-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval monitoringdata="{\"deliverableType\":null,\"docType\":null,\"acProgram\":null,\"docId\":null,\"revisionDate\":null,\"format\":null,\"entity\":null,\"customersRightStatus\":null,\"customersRightEventDate\":null,\"majorEvent\":null,\"emergency\":null,\"attachmentType\":null,\"attachmentIssueDate\":null,\"acknowledgment\":null,\"acknowledgmentDate\":null,\"productionOrder\":null,\"domain\":null,\"productKey\":\"#[A350]#HHJ#CSDBL##[PN1234]##\",\"itemId\":\"260_S1KD\",\"onlineAvailabilityData\":{\"type\":\"DownloadState\",\"status\":\"InProgress\",\"fromDate\":null,\"toDate\":null},\"acksStatus\":null}"| rex max_match=0 field=monitoringdata "(?&amp;lt;key&amp;gt;\w+)\":\"?(?&amp;lt;value&amp;gt;\"?[^,\"]+)"|table key, value|eval b=mvzip(key,value)|mvexpand b| makemv b delim=","|eval key=mvindex(b, 0)| eval value=mvindex(b, 1)|table key value| transpose 0 header_field=key
 | fields - column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Jul 2018 13:36:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378784#M111018</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-07-29T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378785#M111019</link>
      <description>&lt;P&gt;Hi Thanks for the suggestion.&lt;BR /&gt;
 &lt;STRONG&gt;answer1&lt;/STRONG&gt; I got result (0) . Link: &lt;A href="https://imgur.com/a/4p3ID6v"&gt;https://imgur.com/a/4p3ID6v&lt;/A&gt;&lt;BR /&gt;
 &lt;STRONG&gt;answer2&lt;/STRONG&gt;: It gives result 1 for specifc filed. What if there are many  &lt;STRONG&gt;monitoringdata&lt;/STRONG&gt; in one single event.&lt;/P&gt;

&lt;P&gt;I have 16 &lt;STRONG&gt;monitoringdata&lt;/STRONG&gt; in my file.&lt;/P&gt;

&lt;P&gt;Please suggest as well.&lt;/P&gt;

&lt;P&gt;Thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 16:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378785#M111019</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-29T16:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378786#M111020</link>
      <description>&lt;P&gt;change fieldname as &lt;CODE&gt;monitoringData&lt;/CODE&gt; and try again as field names are case sensitive&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| rex max_match=0 field=monitoringData "(?&amp;lt;key&amp;gt;\w+)\":\"?(?&amp;lt;value&amp;gt;\"?[^,\"]+)"|table key, value|eval b=mvzip(key,value)|mvexpand b| makemv b delim=","|eval key=mvindex(b, 0)| eval value=mvindex(b, 1)|table key value| transpose 0 header_field=key
  | fields - column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Jul 2018 17:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378786#M111020</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-07-29T17:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378787#M111021</link>
      <description>&lt;P&gt;Just a little addition to this: this method will make your Splunk explode once you put a lot of events through the &lt;CODE&gt;mvexpand&lt;/CODE&gt;. &lt;BR /&gt;
Here is a link &lt;A href="https://answers.splunk.com/answers/319646/how-to-write-the-regex-to-extract-data-inside-squa.html"&gt;https://answers.splunk.com/answers/319646/how-to-write-the-regex-to-extract-data-inside-squa.html&lt;/A&gt; to an answer doing the same using &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 20:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378787#M111021</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-07-29T20:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378788#M111022</link>
      <description>&lt;P&gt;Hi @MuS , Hi @493669,&lt;/P&gt;

&lt;P&gt;Thanks for the answer, just one more quick if i need to export the report for &lt;STRONG&gt;monitorData&lt;/STRONG&gt; based on &lt;STRONG&gt;itemId&lt;/STRONG&gt; in json then what type of search i have to write.&lt;/P&gt;

&lt;P&gt;Like i need whole &lt;STRONG&gt;monitorData&lt;/STRONG&gt;  for &lt;STRONG&gt;itemId&lt;/STRONG&gt; (key="itemId ") whose value is &lt;STRONG&gt;260_S1KD&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 09:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378788#M111022</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-30T09:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378789#M111023</link>
      <description>&lt;P&gt;if you made changes in props.conf and transforms.conf as suggested by @MuS then fields get extracted at search time then simply apply filter on itemId as shown below and export in JSON format-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logadns"|where itemId="260_S1KD"|table monitoringData
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jul 2018 11:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378789#M111023</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-07-30T11:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378790#M111024</link>
      <description>&lt;P&gt;Thank you very much @493669 and @MuS for your support.&lt;BR /&gt;
:)&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 12:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378790#M111024</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-30T12:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378791#M111025</link>
      <description>&lt;P&gt;@493669 please post you comment in &lt;STRONG&gt;answer section&lt;/STRONG&gt;  so that I can mark as &lt;STRONG&gt;accepted&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 12:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378791#M111025</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-30T12:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378792#M111026</link>
      <description>&lt;P&gt;Hi Rajesh @493669 &lt;BR /&gt;
Do you have any idea on my another question:&lt;BR /&gt;
Please have a look:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/674429/not-monitored-similer-name-local-files-on-windows.html"&gt;https://answers.splunk.com/answers/674429/not-monitored-similer-name-local-files-on-windows.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 05:28:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378792#M111026</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-07-31T05:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378793#M111027</link>
      <description>&lt;P&gt;Hi @493669&lt;/P&gt;

&lt;P&gt;In MonitorData , there are 25 keys(itemId, docType,.....)&lt;/P&gt;

&lt;P&gt;and each key contains no of value(eg. itemId contains 100 different values) ....... can i extract each value as seprate event.&lt;BR /&gt;
like itemId, doctype.&lt;/P&gt;

&lt;P&gt;Please suggest as well. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 07:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378793#M111027</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-08-01T07:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378794#M111028</link>
      <description>&lt;P&gt;Hi @493669  can i connect with you regarding some question on splunk.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 05:53:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378794#M111028</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-08-30T05:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378795#M111029</link>
      <description>&lt;P&gt;you can connect me on &lt;A href="mailto:mandalerajesh@yahoo.in"&gt;mandalerajesh@yahoo.in&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 06:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378795#M111029</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-08-30T06:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields in a file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378796#M111030</link>
      <description>&lt;P&gt;@493669 Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 06:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-in-a-file/m-p/378796#M111030</guid>
      <dc:creator>dhirendra761</dc:creator>
      <dc:date>2018-08-30T06:14:47Z</dc:date>
    </item>
  </channel>
</rss>

