<?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 Filter data from json file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704416#M238699</link>
    <description>&lt;P&gt;Team,&lt;BR /&gt;I am bit new to Splunk, need help to pull ERR message from below sample raw data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{"hosting_environment": "nonp", "application_environment": "nonp", "message": "[20621] 2024/11/14 12:39:46.899958 [ERR] 10.25.1.2:30080 - pid:96866" - unable to connect to endpoint , "service": "hello world"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 13:36:03 GMT</pubDate>
    <dc:creator>drogo</dc:creator>
    <dc:date>2024-11-14T13:36:03Z</dc:date>
    <item>
      <title>Filter data from json file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704416#M238699</link>
      <description>&lt;P&gt;Team,&lt;BR /&gt;I am bit new to Splunk, need help to pull ERR message from below sample raw data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{"hosting_environment": "nonp", "application_environment": "nonp", "message": "[20621] 2024/11/14 12:39:46.899958 [ERR] 10.25.1.2:30080 - pid:96866" - unable to connect to endpoint , "service": "hello world"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 13:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704416#M238699</guid>
      <dc:creator>drogo</dc:creator>
      <dc:date>2024-11-14T13:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data from json file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704417#M238700</link>
      <description>&lt;P&gt;This is a bit vague - Do you want to search for events that have ERR in? Do you want to extract what comes after "[ERR}" in the message field? Do you already have these JSON fields extracted?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 13:42:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704417#M238700</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-11-14T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data from json file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704418#M238701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254896"&gt;@drogo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;if you use the INDEXED_EXTRACTIONS=JSON option for the sourcetype you're using for those data, you have all the fileds extracted.&lt;/P&gt;&lt;P&gt;If you don't see this field, youcan use a regex to extract it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\d*\s\[(?&amp;lt;message&amp;gt;[^\]]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/QcGAwT/1" target="_blank"&gt;https://regex101.com/r/QcGAwT/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 13:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704418#M238701</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-11-14T13:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data from json file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704477#M238709</link>
      <description>&lt;P&gt;If your events are truly in JSON, you are asking the wrong question. &amp;nbsp;Let me explain.&lt;/P&gt;&lt;P&gt;The sample you illustrated above is not JSON compliant. &amp;nbsp;Specifically, quotation marks are badly placed. &amp;nbsp;So, the most important question is whether the sample is faithful. &amp;nbsp;Or do you mean a compliant JSON like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"hosting_environment": "nonp", "application_environment": "nonp", "message": "[20621] 2024/11/14 12:39:46.899958 [ERR] 10.25.1.2:30080 - pid:96866 - unable to connect to endpoint", "service": "hello world"}&lt;/LI-CODE&gt;&lt;P&gt;Assuming your raw events are JSON compliant, Splunk would give you a field named &lt;U&gt;message&lt;/U&gt;. &amp;nbsp;The task is simply to extract the desired part from this field. &amp;nbsp;In other words, the fact that data is JSON should have no bearing on your question. &amp;nbsp;If I read your mind correctly, you want the string after [ERR]. (I'm not joking about reading mind. &amp;nbsp;You should always illustrate what you want using sample data.) &amp;nbsp;Therefore&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=message "\[ERR\] (?&amp;lt;error&amp;gt;.+)"&lt;/LI-CODE&gt;&lt;P&gt;If, on the other hand, your raw events are mangled like in your illustration, the answer will depend on how badly mangled the events are. &amp;nbsp;The best solution would be to implore your developers to fix the log.&lt;/P&gt;&lt;P&gt;Either way, the question is really not about JSON.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 06:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-data-from-json-file/m-p/704477#M238709</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-11-15T06:41:06Z</dc:date>
    </item>
  </channel>
</rss>

