<?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: Powershell Script Input via JSON not parsing correctly? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/612744#M106016</link>
    <description>&lt;P&gt;No One? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; at least a discussion would be nice... i can also see errors in the internal log... some parsing / linebreaker errors... but i cant find those on the file if i output vie | out-file &amp;lt;filename&amp;gt; from powershell... the resulting .json is ok according to testtools and i cant find any problems... i am at a loss...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Errors:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="768px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="767px" height="261px"&gt;&lt;P data-unlink="true"&gt;had parsing error:Unexpected character while looking for value: ',' - data_source="powershell://Get_AD_Report", data_host="nope", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while looking for value: '}' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while parsing backslash escape: 'x' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while looking for value: ']' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So yes i would also say there should be a /x somewhere in the data... cant find it after i output it... i "think" its a encoding/decoding problem of some kind... i assume powershell direkt output is some Charset and maybe i just have to find the right Charset in Splunk... but somehow i simply dont get my actual problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 13:18:54 GMT</pubDate>
    <dc:creator>Stephan_BP</dc:creator>
    <dc:date>2022-09-12T13:18:54Z</dc:date>
    <item>
      <title>Powershell Script Input via JSON not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/607025#M105419</link>
      <description>&lt;P&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have a curious problem. (btw. not my first Powershell input &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to Input some Active Directory Data into Splunk right now. Below a bit changed output of my Script:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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; [
   {
        "SpecialUsers_S":  false,
        "SpecialUsers_X":  false,
        "SpecialUsers_U":  false,
        "SpecialUsers_A":  false,
        "SpecialUsers_TBM":  false,
        "SpecialUsers_T":  false,
        "HR_Canceled_Users":  false,
        "HR_Inactive_Users":  false,
        "HR_Temporary-Inactive_Users":  false,
        "FehlerStatus":  "0",
        "PasswordNeverExpires_State":  "null",
        "OU_State":  "null",
        "Account_State":  "null",
        "Manager_State":  "null",
        "Account_Expiration_Date":  "null",
        "EmployeeNumberError":  "null",
        "DescriptionError":  "null",
        "ManagersViaGroup":  "null",
        "Wrong_Name":  "null",
        "Wrong_EMail":  "null",
        "Manager_Description":  "null",
        "Multiple_SpecialGroups":  "null",
        "Multiple_HR_Groups":  "null",
        "SamAccountName":  "SamAccount01",
        "Enabled":  true,
        "EmployeeNumber":  "11112",
        "SN":  "Surname01",
        "Description":  "0200000000",
        "Department":  "Department01",
        "Company":  "The Firm",
        "emailaddress":  "Email01@domain.com",
        "DistinguishedName":  "The Distinguished Name 01",
        "hkDS-EntryDate":  "09.09.1991 02:00:00",
        "LastLogonDate":  "18.07.2022 07:22:38",
        "PasswordLastSet":  "02.06.2022 09:22:36"
    },
    {
        "SpecialUsers_S":  false,
        "SpecialUsers_X":  false,
        "SpecialUsers_U":  false,
        "SpecialUsers_A":  false,
        "SpecialUsers_TBM":  false,
        "SpecialUsers_T":  false,
        "HR_Canceled_Users":  false,
        "HR_Inactive_Users":  false,
        "HR_Temporary-Inactive_Users":  false,
        "FehlerStatus":  "0",
        "PasswordNeverExpires_State":  "null",
        "OU_State":  "null",
        "Account_State":  "null",
        "Manager_State":  "null",
        "Account_Expiration_Date":  "null",
        "EmployeeNumberError":  "null",
        "DescriptionError":  "null",
        "ManagersViaGroup":  "null",
        "Wrong_Name":  "null",
        "Wrong_EMail":  "null",
        "Manager_Description":  "null",
        "Multiple_SpecialGroups":  "null",
        "Multiple_HR_Groups":  "null",
        "SamAccountName":  "SamAccount02",
        "Enabled":  true,
        "EmployeeNumber":  "11113",
        "SN":  "Surname02",
        "Description":  "000000000",
        "Department":  "Department02",
        "Company":  "The Firm",
        "emailaddress":  "email02@Domain.com",
        "DistinguishedName":  "The Distinguished Name 01",
        "hkDS-EntryDate":  "10.10.2002 02:00:00",
        "LastLogonDate":  "18.07.2022 08:07:31",
        "PasswordLastSet":  "26.05.2022 17:27:42"
    }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Exported into File and testet with Validators all is fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what i see in Splunk is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;        "SpecialUsers_S":  false,
        "SpecialUsers_X":  false,
        "SpecialUsers_U":  false,
        "SpecialUsers_A":  false,
        "SpecialUsers_TBM":  false,
        "SpecialUsers_T":  false,
        "HR_Canceled_Users":  false,
        "HR_Inactive_Users":  false,
        "HR_Temporary-Inactive_Users":  false,
        "FehlerStatus":  "0",
        "PasswordNeverExpires_State":  "null",
        "OU_State":  "null",
        "Account_State":  "null",
        "Manager_State":  "null",
        "Account_Expiration_Date":  "null",
        "EmployeeNumberError":  "null",
        "DescriptionError":  "null",
        "ManagersViaGroup":  "null",
        "Wrong_Name":  "null",
        "Wrong_EMail":  "null",
        "Manager_Description":  "null",
        "Multiple_SpecialGroups":  "null",
        "Multiple_HR_Groups":  "null",
        "SamAccountName":  "SamAccount01",
        "Enabled":  true,
        "EmployeeNumber":  "null",
        "SN":  "",
        "Description":  "null",
        "Department":  "null",
        "Company":  "",
        "emailaddress":  null,
        "DistinguishedName":  "The Distinguished Name",
        "hkDS-EntryDate":  "null",
        "LastLogonDate":  "null",
        "PasswordLastSet":  "null"
    }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As u can see i am missing a lot of information, and i cant figure out why... Some like SamAccountName and DistinguishedName is working but other variables like Company, Department or Description are missing...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Skript is rather long but if needed i can post Parts of it how i do stuff &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the inputs.conf for this is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;[powershell://Get_AD_Report]
script = . "$SplunkHome\etc\system\bin\Powershell\GetADReport.ps1"
schedule=15 * * * *
sourcetype=_json
index=hk_office365&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe someone as some kind of clue whats happening there for me?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would really help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; am on this for much to long already &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; and tried so many different ways now...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 14:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/607025#M105419</guid>
      <dc:creator>Stephan_BP</dc:creator>
      <dc:date>2022-07-26T14:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell Script Input via JSON not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/612744#M106016</link>
      <description>&lt;P&gt;No One? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; at least a discussion would be nice... i can also see errors in the internal log... some parsing / linebreaker errors... but i cant find those on the file if i output vie | out-file &amp;lt;filename&amp;gt; from powershell... the resulting .json is ok according to testtools and i cant find any problems... i am at a loss...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Errors:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="768px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="767px" height="261px"&gt;&lt;P data-unlink="true"&gt;had parsing error:Unexpected character while looking for value: ',' - data_source="powershell://Get_AD_Report", data_host="nope", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while looking for value: '}' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while parsing backslash escape: 'x' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;JSON StreamId:2583583993661161172 had parsing error:Unexpected character while looking for value: ']' - data_source="powershell://Get_AD_Report", data_host="&amp;nbsp;nope&amp;nbsp;", data_sourcetype="_json"&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So yes i would also say there should be a /x somewhere in the data... cant find it after i output it... i "think" its a encoding/decoding problem of some kind... i assume powershell direkt output is some Charset and maybe i just have to find the right Charset in Splunk... but somehow i simply dont get my actual problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 13:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/612744#M106016</guid>
      <dc:creator>Stephan_BP</dc:creator>
      <dc:date>2022-09-12T13:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell Script Input via JSON not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613738#M106208</link>
      <description>&lt;P&gt;Ok, i gotten a bit further now... it seems to work properly "ONCE" after i restart the SplunkForwarderService, but the next scheduled time it executes it goes back to leave data out of the events... cant see errors anymore either...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really confused by now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; maybe someone seeing this behavior?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Props.conf on Universalforwarder thats working "ONCE" after Restart:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[_json2]&lt;BR /&gt;pulldown_type = true&lt;BR /&gt;INDEXED_EXTRACTIONS = json&lt;BR /&gt;AUTO_KV_JSON = false&lt;BR /&gt;TRUNCATE = 100000&lt;BR /&gt;CHARSET = utf-8&lt;BR /&gt;KV_MODE = none&lt;BR /&gt;category = Structured&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 08:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613738#M106208</guid>
      <dc:creator>Stephan_BP</dc:creator>
      <dc:date>2022-09-20T08:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell Script Input via JSON not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613739#M106209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244049"&gt;@Stephan_BP&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you please try writing output without an array? I mean each result will be a single JSON that contains only one account.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 08:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613739#M106209</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-20T08:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell Script Input via JSON not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613887#M106243</link>
      <description>&lt;P&gt;Hi scelikok,&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure i get what u mean &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes my Output of the Powershellscript is in the Format of:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;[ { User1values}, {User2values}, ... {UserXvalues} ]&lt;/P&gt;&lt;P&gt;and this might be a problem?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk correctly creates the events like i want it to For Each User 1 Event. From this point of view i feel its working fine...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply dont get why the values are wrong... and not only wrong... simply the same for each User except for a few fields...&lt;/P&gt;&lt;P&gt;and right after a Universalforwarderservice restart it seems to work now but only there... (except i have double extractions now and have to fix this now aswell) ... each scheduled start of the script it again gives me wrong values...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 07:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Powershell-Script-Input-via-JSON-not-parsing-correctly/m-p/613887#M106243</guid>
      <dc:creator>Stephan_BP</dc:creator>
      <dc:date>2022-09-21T07:29:50Z</dc:date>
    </item>
  </channel>
</rss>

