appcmd.exe to list IIS config section attribute is returning an ERROR message:Unknown attribute - iis

I am running this command as admin in elevated prompt:
%systemroot%\system32\inetsrv\appcmd list config "website" /section:requestFiltering /text:AllowDoubleEscaping
It returns error message: ERROR (message:Unknown attribute ""AllowDoubleEscaping"". Replace with -? for help.)
So I next ran the following command:
%systemroot%\system32\inetsrv\appcmd set config -section:requestFiltering -?
It returned this output and yes, I can see that the allowDoubleEscaping is missing
ERROR ( message:-allowHighBitCharacters
-unescapeQueryString
-removeServerHeader
-fileExtensions.allowUnlisted
-fileExtensions.applyToWebDAV
-fileExtensions.[fileExtension='string'].fileExtension
-fileExtensions.[fileExtension='string'].allowed
-requestLimits.maxAllowedContentLength
-requestLimits.maxUrl
-requestLimits.maxQueryString
-requestLimits.headerLimits.[header='string'].header
-requestLimits.headerLimits.[header='string'].sizeLimit
-verbs.allowUnlisted
-verbs.applyToWebDAV
-verbs.[verb='string'].verb
-verbs.[verb='string'].allowed
-hiddenSegments.applyToWebDAV
-hiddenSegments.[segment='string'].segment
-alwaysAllowedUrls.[url='string'].url
-alwaysAllowedQueryStrings.[queryString='string'].queryString
-denyUrlSequences.[sequence='string'].sequence
-denyQueryStringSequences.[sequence='string'].sequence
-filteringRules.[name='string'].name
-filteringRules.[name='string'].scanUrl
-filteringRules.[name='string'].scanQueryString
-filteringRules.[name='string'].scanAllRaw
-filteringRules.[name='string'].denyUnescapedPercent
-filteringRules.[name='string'].scanHeaders.[requestHeader='string'].requestHeader
-filteringRules.[name='string'].appliesTo.[fileExtension='string'].fileExtension
-filteringRules.[name='string'].denyStrings.[string='string'].string
So which files is appcmd actually checking for these? I went ahead and checked the C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml file and it does have this attribute defined in there. This seems to be the only place this is defined, so I am confused where else its not finding this attribute to throw the error??
<sectionSchema name="system.webServer/security/requestFiltering">
<attribute name="allowDoubleEscaping" type="bool" defaultValue="false" />
<attribute name="allowHighBitCharacters" type="bool" defaultValue="true" />
<attribute name="unescapeQueryString" type="bool" defaultValue="true" />

Related

NLog.Targets.Splunk - Possible to get rid of the "Properties" wrap?

In: NLog.Targets.Splunk
https://github.com/AlanBarber/NLog.Targets.Splunk
When use the nlog configuration with:
includeEventProperties="true"
or if I have:
includeEventProperties="false" and use:
<contextproperty name="host" layout="${machinename}" />
<contextproperty name="threadid" layout="${threadid}" />
<contextproperty name="logger" layout="${logger}" />
I get the logs in the following format (properties wrapped in "Properties"):
{"Level":"Info","MessageTemplate":"ApiRequest","RenderedMessage":"ApiRequest","Properties":{"httpMethod":"GET","statusCode":200}, ...}
Is it possible to get rid of the Properties-wrap, and have it more flat?
{ "Level": "Info", "httpMethod": "GET", "statusCode":200, ... }
Many thanks! :-)

Log4Net not displaying an accurate Timestamp

I'm logging an Azure-based webapp using a Log4Net CSV appender with:
I'm seeing multiple entries with an identical timestamp - clearly not logging the actual instant of a given event on the server:
2018-03-19 21:59:52.000 OrderId: 191096 Starts to validate, multi:
2018-03-19 21:59:52.000 OrderId: 191096 validation request:
2018-03-19 21:59:52.000 OrderId: 191096 passed validation. AuthKey:6128994
2018-03-19 21:59:52.000 OrderId: 191096 Single starts
2018-03-19 21:59:52.000 OrderId: 191096 submits:
2018-03-19 21:59:52.000 SaveOrderChanges: 191096
2018-03-19 21:59:52.000 SaveOrderChanges: 191096
I had thought perhaps it take to do with when the logs are written out to file vs. when the entry is literally generated but unless I'm mis-reading the context, this answer indicates otherwise.
Clearly I have something misconfigured. My CSV is built using code found at: http://element533.blogspot.com/2010/05/writing-to-csv-using-log4net.html
Full appender:
<appender name="CsvFileAppender" type="log4net.Appender.FileAppender">
<file value="D:/home/logfiles/log4netCSV.log" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true"/>
<threshold value="INFO" />
<layout type=" myWeb.CsvPatternLayout, myWeb">
<header value="DateTime,Thread,Level,Logger,Message,Exception
" />
<conversionPattern value="%date%newfield[%thread]%newfield %-5level%newfield% %property{Ip} _+ %aspnet-request{ASP.NET_SessionId} _+ %logger %newfield%message%newfield%exception%endrow" />
</layout>
</appender>
It is very strange that your dates are showing
2018-03-19 21:59:52.000
The default format is Iso8601 and separator between second and milisec is a comma:
https://github.com/apache/logging-log4net/blob/master/src/DateFormatter/Iso8601DateFormatter.cs#L26
I recommend you to use explicit dates:
%date{yyyy-MM-dd HH:mm:ss.fff}
Also if you want a CSV file you need to separate the values with commas:
<conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fff},[%thread],%level,..." />
Update:
I just tested this on Azure to see if it had anything to do, and it shows correctly:
http://swagger-net-test.azurewebsites.net/log4net.log
I have two log actions one right after the other and they do show different time stamps
DateTime,Thread,Level,Logger,Message
2018-04-08 13:19:48.658,[20],INFO,Swagger_Test.Controllers.LogController,Test1
2018-04-08 13:19:48.689,[20],ERROR,Swagger_Test.Controllers.LogController,Test2

Getting org.apache.camel.NoTypeConversionAvailableException in JBoss Fuse

I'm getting the error below in JBoss Fuse.
Can someone tell me what's the reason that's causing this issue?
And is there a way to resolve it?
java.io.IOException: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: com.abc.ws.ABC to the required type: java.io.InputStream with value com.abc.ws.ABC#7644b2af at org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:153) :
<dataFormats>
<jaxb contextPath="generated" id="generated"/>
<jaxb contextPath="com.abc.ws" encoding="UTF-8" id="ABC"
partClass="com.abc.ws.ABC" prettyPrint="true"/>
</dataFormats>
<route autoStartup="true" id="LogCreateOrgRequest">
<from id="_from10" uri="seda:logOrganisationRequest"/>
<process id="_process17" ref="AbcProcessor"/>
<marshal id="_marshal1" ref="ABC"/>
<convertBodyTo id="_convertBodyTo2" type="java.lang.String"/>
<setBody id="_setBody18">
<simple> Request - [${date:now:yyyy-MM-dd'T'HH:mm:ss.SSS.Z}]\nTransactionID
- ${exchangeProperty.CAFNo}\n${body}\n</simple>
</setBody>
<to id="_to40" pattern="InOut" uri="file:/opt/logs/demographicSetup/ABC?
keepLastModified=true&fileExist=Append&fileName=CreateOrgRequest-${date:now:yyyyMMdd}.txt&readLock=changed"/>
</route>`

Variable in WildFly: Cannot resolve expression on Linux

My setting
standalone.conf.bat
set "DBO_PATH_CONFIG=D:/test"
set "MOBILE_KEYSTORE=jboss.mobile.keystore"
standalone.conf
set "DBO_PATH_CONFIG=/opt/!!!"
set "MOBILE_KEYSTORE=jboss.mobile.keystore"
standalone.xml
<security-realm name="SslRealm">
<server-identities>
<ssl>
<keystore path="${env.DBO_PATH_CONFIG}/${env.MOBILE_KEYSTORE}" keystore-password="rmi+ssl"/>
</ssl>
</server-identities>
</security-realm>
Properties
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<simple name="java:/propertiesFileName" value="NONE" />
<simple name="java:/propertiesFileNameV1" value="${env.DBO_PATH_CONFIG}/V1.properties" />
<simple name="java:/propertiesFileNameV2" value="${env.DBO_PATH_CONFIG}/V2.properties" />
</bindings>
<remote-naming />
</subsystem>
On Windows all works fine but on Linux I have this error:
10:57:34,512 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("core-service" => "management"),
("security-realm" => "SslRealm")
]) - failure description: "WFLYCTL0211: Cannot resolve expression '${env.DBO_PATH_CONFIG}/${env.MOBILE_KEYSTORE}'"
How to solve this problem?
On Linux it's export not set. I also don't think you can have a directory called !!!. ! has a special meaning in bash.

How can I access properties from a running workflow 2013 instance using CSOM?

I am trying to figure out how I can access properties of a running workflow instance. I have created the following PowerShell:
Add-PSSnapin microsoft.sharepoint.powershell
$web = Get-SPWeb http://app-72b5c37f94da1d.apps.sharepoint2013.local/sites/appdev/SharePointWorkflowApp
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$list= ($web.lists|where Title -eq "List1")
$sub = $wfm.GetWorkflowSubscriptionService()
$subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
$inst = $wfm.GetWorkflowInstanceService()
$instances= $inst.Enumerate($subscriptions[0])
$instance= $instances[0]
$instance.Status
$instance.UserStatus
$instance.Properties
I am not able to retrieve the arguments or variables via this route. Only UserStatus is a valid working option at this point.
The variables and arguments of the sequence which I have configured via Visual Studio 2013's Workflow Designer, resulted in the following xaml:
<x:Members>
<x:Property Name="EenArg" Type="InArgument(x:String)" />
<x:Property Name="argument1" Type="x:String" />
<x:Property Name="argument2" Type="InOutArgument(x:String)" />
<x:Property Name="strArg" Type="InOutArgument(x:String)" />
<x:Property Name="intArg" Type="InOutArgument(x:String)" />
<x:Property Name="dateTimeArg" Type="InOutArgument(x:String)" />
</x:Members>
None of which are propagated via de Properties collection.
What am I missing here?
(crossposted at MSDN Forums as well:
http://social.msdn.microsoft.com/Forums/en-US/482412b9-86ca-435e-becb-bfbc6a33c378/how-to-access-properties-of-running-workflow-2013-instances?forum=sharepointdevelopment)

Resources