Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure PartitionKey using Semantic Logging Windows Azure

Tags:

logging

azure

I am trying to configure Semantinc Logging out of the process to write to Azure.

I finally managed to write events into a Table storage. My problem is how do I define PartitionKey.

I just inserted a couple of tests and the PartitionKeys are:

2520107100599999999
2520107103599999999

I would like to have the partitions defined by me (for instance, partition by day).

How do I do that?

This is my actual configuration

<windowsAzureTableSink name="Windows Azure Storage" instanceName="xxxxxxx" connectionString="xxxxxxx">
    <sources>
        <eventSource name="myCompany" level="Error"/>
    </sources>
</windowsAzureTableSink>
like image 432
Jordi Avatar asked Nov 02 '22 05:11

Jordi


1 Answers

Not really an answer to your question but I'm guessing that you would want to specify partition by day because you would want to query this data on a date basis. Assuming this is correct, you can still achieve this with the current partitioning scheme. Essentially the PartitionKey you see represents date/time value. This is how it is derived:

DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks

The PartitionKey value has minute level granularity. So if you apply the logic above, 2520107100599999999 essentially translates to 2014-02-05T08:59:00Z.

Again, I may be wrong in my assumption and if that's the case, please let me know and I'll delete the answer. Thought I would post it as it is not really obvious that a date/time value can be derived from PartitionKey value.

like image 60
Gaurav Mantri Avatar answered Nov 13 '22 14:11

Gaurav Mantri